You’ve rented a VPS. Now what? In one hour, you’ll go from a fresh IP address to a fully functioning production web app — with SSH hardened, a web server running, a database installed, and your application deployed. No control panels, no fluff. Just commands that work on any Ubuntu 24.04 or Debian 12 server.
0–10 Minutes: SSH Login and Hardening
Your provider sent you an IP address and root password. Let’s lock that down immediately.
Connect:
ssh root@your-server-ip
Create a non-root user with sudo:
adduser deployer
usermod -aG sudo deployer
su - deployer
Set up SSH key authentication:
mkdir -p ~/.ssh
chmod 700 ~/.ssh
echo "your-public-key-here" >> ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
Now disable root password login: run sudo nano /etc/ssh/sshd_config and set PermitRootLogin prohibit-password and PasswordAuthentication no. Then sudo systemctl restart sshd.
Set up the firewall:
sudo ufw allow OpenSSH
sudo ufw enable
sudo ufw status
10–25 Minutes: Install a Web Server and Database
We’ll use Nginx and PostgreSQL — a fast, modern stack. For a WordPress setup, swap PostgreSQL for MySQL.
sudo apt update && sudo apt upgrade -y
sudo apt install nginx postgresql postgresql-contrib certbot python3-certbot-nginx -y
Start and enable services:
sudo systemctl enable --now nginx
sudo systemctl enable --now postgresql
Create a database and user for your app:
sudo -u postgres psql -c "CREATE USER appuser WITH PASSWORD 'strong-password-here';"
sudo -u postgres psql -c "CREATE DATABASE myapp OWNER appuser;"
sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE myapp TO appuser;"
25–40 Minutes: Configure Nginx and Get a Free SSL Certificate
Create an Nginx server block for your domain:
sudo nano /etc/nginx/sites-available/myapp
server {
listen 80;
server_name your-domain.com www.your-domain.com;
root /var/www/myapp;
index index.html index.php;
location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php8.3-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}
Enable the site and get a Let’s Encrypt certificate:
sudo ln -s /etc/nginx/sites-available/myapp /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx
sudo certbot --nginx -d your-domain.com -d www.your-domain.com
40–55 Minutes: Deploy Your Application
For a Node.js app, install Node and PM2:
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt install nodejs -y
sudo npm install -g pm2
# Clone and start your app
git clone https://github.com/your-org/your-app.git /var/www/myapp
cd /var/www/myapp
npm install
pm2 start app.js --name myapp
pm2 save
pm2 startup systemd
For a PHP app (e.g., Laravel or WordPress), install PHP-FPM and configure Nginx to pass PHP requests through the FastCGI socket shown in the config above.
55–60 Minutes: Verify and Set Up Monitoring
Check everything is running:
sudo systemctl status nginx
sudo systemctl status postgresql
curl -I https://your-domain.com
pm2 status
Install a quick monitoring tool to keep an eye on resources:
sudo apt install htop -y
htop # Hit F9 to sort by CPU usage
Set up automatic security updates:
sudo apt install unattended-upgrades -y
sudo dpkg-reconfigure --priority=low unattended-upgrades
What’s Next?
Your VPS is now a production-ready server with SSH key auth, a firewall, Nginx with SSL, PostgreSQL, and a deployed application — all in about an hour. For ongoing maintenance, set up log rotation (logrotate is installed by default) and consider a backup strategy using rsync or provider snapshots.
Choosing the right VPS provider matters for all of this. Compare VPS providers on our performance comparison table to find one with fast provisioning, NVMe storage, and good support — factors that make the first-hour experience smooth.




Leave a Reply
You must be logged in to post a comment.