One evening is enough to go from nothing to a website with HTTPS on your own server. This guide walks the whole path: domain, DNS, web server and certificate, with every command included.

What you will need

  • A domain from any registrar (Namecheap, Porkbun, REG and so on), from a few euros per year.
  • A VPS: the smallest Micro plan is plenty for a start.
  • Thirty to sixty minutes.

Step 1: point the domain at the server

In your registrar's DNS settings create two records, where 203.0.113.10 is your server IP from the client area:

A     @      203.0.113.10
A     www    203.0.113.10

Propagation usually takes minutes, occasionally a couple of hours. Check with dig +short yourdomain.com.

Want a CDN and an extra DDoS shield in front of the site? You can put the domain behind Cloudflare later without touching the server: the setup below stays exactly the same.

Step 2: prepare the server

Order a VPS with Ubuntu 24.04, connect over SSH and bring the system up to date:

ssh [email protected]
apt update && apt -y upgrade
apt -y install nginx
ufw allow 22/tcp && ufw allow 80/tcp && ufw allow 443/tcp
ufw --force enable

Open http://203.0.113.10 in a browser: the nginx welcome page confirms the web server is alive and reachable.

Step 3: serve your content

For a static site, put the files in place and describe the site to nginx:

mkdir -p /var/www/mysite
echo '<h1>It works</h1>' > /var/www/mysite/index.html

cat > /etc/nginx/sites-available/mysite <<'CONF'
server {
    listen 80;
    server_name yourdomain.com www.yourdomain.com;
    root /var/www/mysite;
    index index.html;
}
CONF
ln -s /etc/nginx/sites-available/mysite /etc/nginx/sites-enabled/
nginx -t && systemctl reload nginx

An application in PHP, Python or Node plugs into the same structure: the app listens on a local port and nginx proxies to it with a proxy_pass line instead of root.

Step 4: free HTTPS with Let's Encrypt

apt -y install certbot python3-certbot-nginx
certbot --nginx -d yourdomain.com -d www.yourdomain.com

Certbot obtains the certificate, rewrites the nginx config for HTTPS and installs automatic renewal. Verify with certbot renew --dry-run.

Step 5: the final pass

  • https://yourdomain.com opens with a padlock from any network.
  • curl -I http://yourdomain.com answers with a redirect to HTTPS.
  • A snapshot or a copy of your content lives somewhere outside the server.

If something refuses to open from outside, the port checklist finds the culprit in five minutes.