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
sudo ufw allow OpenSSH
sudo ufw allow 80,443/tcp
sudo ufw enable2. 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.
services:
api:
build: .
env_file: .env
restart: always
ports:
- "4000:4000"
redis:
image: redis:7-alpine
restart: always3. 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.
Tagged:DevOps
Share:


