Website Performance

Starting a Website From Scratch on a VPS: A Step-by-Step Plan

By NileVPS Team · Published · 4 min read

اقرأ المقال بالعربي

Launching a website on your own VPS sounds intimidating the first time, but the work breaks down into a short list of clear steps. Unlike shared hosting, a VPS gives you full control over the software stack, predictable resources and the freedom to grow without moving providers. The trade-off is that you are responsible for the setup. This guide walks through the whole path, from deciding what the site needs to keeping it backed up and monitored, so you can go from an empty server to a live, secure website in an afternoon.

Step 1: Plan before you touch the server

A few decisions made on paper save hours later:

  • What kind of site is it? A static site (HTML, a static site generator), a CMS such as WordPress, or a custom application (Node.js, Python, PHP framework).
  • What does it need to run? A web server, a language runtime, and perhaps a database such as MySQL/MariaDB or PostgreSQL.
  • How much traffic do you expect at first? Be honest. Most new sites start small, and a VPS can be resized later.

A simple sizing guide for a first server:

Site typeStarting point
Static site or small blog1 vCPU, 1-2 GB RAM
WordPress or small CMS with a database2 vCPU, 2-4 GB RAM
Custom app plus database2-4 vCPU, 4-8 GB RAM

You can compare plans on the pricing page and start with the smallest one that fits.

Step 2: Get a domain and point it at the server

Register a domain (see our guide on choosing a domain name), then create DNS records at your registrar or DNS provider:

  • An A record for example.com pointing to your server's IPv4 address.
  • An AAAA record if you use IPv6.
  • A CNAME (or another A record) for www.

DNS changes can take a while to propagate, so do this early. You can check with dig +short example.com.

Step 3: Create and secure the server

Deploy a VPS with a current long-term-support distribution such as Ubuntu 24.04 LTS or Debian 12. Then log in and do the basics:

# Update the system
sudo apt update && sudo apt upgrade -y

# Create a regular user with sudo rights
sudo adduser deploy
sudo usermod -aG sudo deploy

# Allow only SSH and web traffic
sudo ufw allow OpenSSH
sudo ufw allow 'Nginx Full'   # run after installing Nginx
sudo ufw enable

Set up SSH key login for your new user and disable password authentication in /etc/ssh/sshd_config (PasswordAuthentication no), then restart SSH with sudo systemctl restart ssh. Keep your current session open while you test a new login, so you cannot lock yourself out.

Step 4: Install the web server

Nginx is a common, lightweight choice:

sudo apt install nginx -y
sudo mkdir -p /var/www/example.com
sudo chown -R deploy:deploy /var/www/example.com

Create /etc/nginx/sites-available/example.com:

server {
    listen 80;
    listen [::]:80;
    server_name example.com www.example.com;
    root /var/www/example.com;
    index index.html index.php;

    location / {
        try_files $uri $uri/ =404;
    }
}

Enable it and reload:

sudo ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/
sudo nginx -t && sudo systemctl reload nginx

For PHP sites, install php-fpm and add a location ~ \.php$ block that passes requests to the PHP-FPM socket. For Node.js or Python apps, run the app on a local port and use Nginx as a reverse proxy with proxy_pass http://127.0.0.1:3000;.

Step 5: Turn on HTTPS for free

Let's Encrypt certificates are free and renew automatically with Certbot:

sudo apt install certbot python3-certbot-nginx -y
sudo certbot --nginx -d example.com -d www.example.com

Certbot edits your Nginx config and installs a renewal timer. Test renewal with sudo certbot renew --dry-run.

Step 6: Deploy your content

For a static site, copy the files with rsync:

rsync -avz --delete ./public/ [email protected]:/var/www/example.com/

For applications, a Git-based workflow is cleaner: push to a repository, pull on the server, install dependencies, and restart the service (managed by systemd or a process manager). As the project grows, consider containers or a CI pipeline.

Step 7: Backups and monitoring from day one

Do not wait for the first incident:

  • Snapshots before major changes give you a quick rollback point.
  • Regular backups of files and databases (for example a nightly mysqldump or pg_dump) copied off the server.
  • Uptime monitoring with a simple external checker so you hear about downtime before your visitors do.
  • Automatic security updates with unattended-upgrades on Debian and Ubuntu.

Launch checklist

  • [ ] Domain resolves to the server (A/AAAA records)
  • [ ] SSH keys only, firewall enabled
  • [ ] Nginx config passes nginx -t
  • [ ] HTTPS works and HTTP redirects to HTTPS
  • [ ] Backups run and a test restore succeeded
  • [ ] Uptime monitor configured

FAQ

Do I need Linux experience to start a website on a VPS?

Basic comfort with the command line helps, but you do not need to be an expert. The steps above use a small set of commands, and each one is safe to learn as you go. A browser console is also useful if you ever lock yourself out of SSH.

Should I use a control panel instead of the command line?

A control panel can simplify managing several sites, mail and databases, but it uses resources and adds another piece of software to maintain. For one or two sites, a plain Nginx setup is lean and easy to understand.

How do I know when to upgrade my VPS?

Watch CPU, memory and disk usage over time. If memory is regularly full, the server starts swapping, or response times climb under normal traffic, it is time to resize or optimize the application.

Related guides