50 items~60 min

Server Production Readiness

Step-by-step checklist for Ubuntu VPS production setup: security, Docker, Nginx, SSL, backups, monitoring.

serverproductionubuntusecuritydockernginxssl
0/50
0%

You've rented a VPS and got SSH access. Just push the code and start Docker? No. A production server is an ecosystem of security, monitoring, backups, and optimization. This checklist walks you through every step.

1

Server Requirements

Make sure your VPS meets the minimum requirements.

0/5

LTS = 5 years of support and security updates. Most guides and docs are written for Ubuntu.

The NestJS + React + PostgreSQL + Redis stack requires at least 4 GB.

2

First Login and System Update

Connect to the server and install basic utilities.

0/3
ssh root@YOUR_SERVER_IP
apt update && apt upgrade -y
apt install -y curl wget git vim htop ufw
3

Firewall Setup (UFW)

Configure the firewall BEFORE enabling it — otherwise you risk locking yourself out.

0/6
sudo ufw default deny incoming
sudo ufw default allow outgoing

If you enable UFW without this rule, you will lose access to the server.

sudo ufw allow 22/tcp comment 'SSH'
sudo ufw allow 80/tcp comment 'HTTP'
sudo ufw allow 443/tcp comment 'HTTPS'
sudo ufw enable
sudo ufw status numbered

Do NOT expose PostgreSQL (5432), Redis (6379), or pgAdmin (8082) to the internet. Use an SSH tunnel instead.

4

Secure SSH Access

Create a user, set up SSH keys, and disable root login.

0/5

Running as root is bad practice. Create a dedicated user.

adduser username
usermod -aG sudo username

SSH keys are more secure than passwords. Copy your public key from your local machine.

ssh-copy-id username@YOUR_SERVER_IP

In a NEW terminal, test: ssh username@YOUR_SERVER_IP. Do not close the current session!

# /etc/ssh/sshd_config
PermitRootLogin no
PasswordAuthentication no
sudo systemctl restart sshd
5

Docker Installation

0/6
sudo apt remove docker docker-engine docker.io containerd runc
sudo apt install -y ca-certificates curl gnupg lsb-release
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo usermod -aG docker $USER
newgrp docker
docker --version
docker compose version
6

Nginx Installation and Configuration

0/4
sudo apt install -y nginx
sudo systemctl status nginx
sudo mkdir -p /etc/nginx/sites-available /etc/nginx/sites-enabled /etc/nginx/conf.d
sudo nginx -t
sudo systemctl restart nginx
7

SSL Certificates (Let's Encrypt)

Before obtaining SSL certificates, make sure DNS records are configured and the domain points to your server.

0/5

Let's Encrypt verifies DNS when issuing a certificate.

sudo apt install -y certbot python3-certbot-nginx
sudo certbot --nginx -d yourdomain.com -d www.yourdomain.com
sudo systemctl status certbot.timer
sudo certbot renew --dry-run
8

Monitoring and Logging

0/4
sudo apt install -y htop
sudo tail -f /var/log/nginx/access.log
sudo tail -f /var/log/nginx/error.log
docker logs -f container_name
sudo journalctl -u nginx -f
sudo journalctl -u docker -f
9

Backups

0/3
#!/bin/bash
BACKUP_DIR="/backups/postgres"
DATE=$(date +%Y%m%d_%H%M%S)
mkdir -p $BACKUP_DIR

docker exec postgres pg_dump -U your_user your_db | gzip > $BACKUP_DIR/backup_$DATE.sql.gz

# Delete backups older than 7 days
find $BACKUP_DIR -name "backup_*.sql.gz" -mtime +7 -delete
sudo chmod +x /usr/local/bin/backup-db.sh
sudo crontab -e
# Add: 0 3 * * * /usr/local/bin/backup-db.sh
10

Final Check

Make sure everything is working before launching your application.

0/9
sudo ufw status
docker --version

Detailed guide on this topic:

Read full article →