RC.dev logo
HomeAboutProjectsSkillsExperienceBlogContact
Hire Me→
  1. Home
  2. Blog
  3. Setting Up a VPS for Production
DevOps

Setting Up a VPS for Production

A step-by-step guide to deploying Node.js apps on a VPS with Docker, NGINX, SSL and CI/CD.

Rasel ChowdhuryBackend & Full Stack Developer

Jul 16, 20255 min read

DevOps

Platforms like Vercel are great, but a VPS gives you full control and lower cost for backend services. Here's the checklist I follow to take a fresh server to production.

1. Secure the server

  • Create a non-root user with sudo access
  • Use SSH keys and disable password login
  • Enable a firewall and allow only ports 22, 80 and 443
  • Keep the system updated automatically
bash
sudo ufw allow OpenSSH
sudo ufw allow 80,443/tcp
sudo ufw enable

2. Run the app with Docker

Docker makes deployments repeatable. I use Docker Compose to run the API, database and Redis together, with environment variables kept out of the image.

yaml
services:
  api:
    build: .
    env_file: .env
    restart: always
    ports:
      - "4000:4000"
  redis:
    image: redis:7-alpine
    restart: always

3. NGINX and SSL

NGINX sits in front of the app as a reverse proxy, and Certbot adds a free Let's Encrypt SSL certificate that renews automatically.

4. Automate deploys with CI/CD

A GitHub Actions workflow builds the image, runs tests and deploys over SSH on every push to main — no more manual uploads.

Don't forget

Set up automatic database backups and basic monitoring before you call it production-ready.

Tagged:DevOps
Share:
Previous ArticleBest Tools for DevelopersNext ArticleMy Learning Journey with DSA

On this page

  1. 1. Secure the server
  2. 2. Run the app with Docker
  3. 3. NGINX and SSL
  4. 4. Automate deploys with CI/CD

About the author

Rasel ChowdhuryBackend & Full Stack Developer

I build scalable backends and AI-powered web products. I write about what I learn along the way.

Share this article

More Articles

View all →
  • Node.js

    How I Built Mino Ride Share

    Sep 12, 2025 · 8 min read

  • System Design

    System Design for Scalable Apps

    Aug 18, 2025 · 6 min read

Rasel Chowdhury

Backend & full-stack developer turning business ideas into scalable, AI-powered digital products.

Available for new projects

Navigation

  • Home
  • About
  • Projects
  • Skills
  • Experience
  • Blog
  • Contact

Expertise

  • Backend Development
  • Full Stack Web Apps
  • REST API Design
  • AI Integration
  • Cloud Deployment

Let's Connect

Have a project in mind? Drop me a line.

chowdhuryrasel040@gmail.com

© 2026 Rasel Chowdhury. All rights reserved.

  • Terms & Condition
  • Privacy Policy
  • Sitemap