Hosting your own website: the VPS route
Updated: 12 August 2026 · Guide · VPS · Website
This assumes a VPS with SSH access and a firewall set up (see “First steps on your own VPS”) and a domain whose A record already points to the VPS IP.
Install the web server
sudo apt update sudo apt install nginx
If you then open your IP in the browser, the nginx default page appears, a sign the web server is running. With ufw, port 80 is part of the predefined profile “Nginx Full”:
sudo ufw allow 'Nginx Full'
Set up your own domain
Create a new file under /etc/nginx/sites-available/<domain>, set server_name in it to your domain and point root at the directory with your files. Then enable it via a symlink and reload nginx:
sudo ln -s /etc/nginx/sites-available/<domain> /etc/nginx/sites-enabled/ sudo nginx -t sudo systemctl reload nginx
HTTPS with Let's Encrypt
certbot handles the certificate and the nginx configuration in one go, free of charge, with automatic renewal:
sudo apt install certbot python3-certbot-nginx sudo certbot --nginx -d your-domain.com
From then on your files go via SFTP straight into the domain's directory, and every change is live immediately.
Suitable VPS sizes for exactly this purpose are listed under /tarife.
Check first: does the domain really point here yet?
By far the most common reason certbot fails is an A record that doesn't point, or no longer points, to the right IP. Let’s Encrypt checks the domain from outside. If the old address is still there, issuance fails, and the error message doesn't hint at it. A quick look beforehand saves the search afterwards:
dig +short your-domain.com curl -sI http://your-domain.com | head -1
DNS changes take minutes to hours, depending on the provider and the previous time to live. If you've only just switched, it's better to wait than to run certbot repeatedly: Let’s Encrypt limits the number of failed attempts per domain and week.
A complete nginx server block
So you don't have to guess the file under /etc/nginx/sites-available/<domain>, here is a working minimal version for a static site:
server {
listen 80;
listen [::]:80;
server_name your-domain.com www.your-domain.com;
root /var/www/your-domain.com;
index index.html;
location / {
try_files $uri $uri/ =404;
}
}certbot later adds the HTTPS part and the redirect from http to https to this file itself. That's why it isn't worth writing the 443 block by hand.
Set permissions correctly
A 403 on the first visit is almost always a permissions problem, not an nginx error. The web server runs as user www-data and must be allowed to read the directory; your own user should be able to write to it:
sudo mkdir -p /var/www/your-domain.com
sudo chown -R $USER:www-data /var/www/your-domain.com
sudo find /var/www/your-domain.com -type d -exec chmod 2755 {} +
sudo find /var/www/your-domain.com -type f -exec chmod 644 {} +Test renewal instead of hoping
certbot sets up automatic renewal itself. Without a test, though, you only find out whether it works when the certificate has expired after 90 days, and that always gets noticed at the worst moment. The dry run takes ten seconds:
sudo certbot renew --dry-run systemctl list-timers | grep certbot
When PHP and a database come in
For WordPress, a forum or your own PHP project you additionally need PHP-FPM and usually a database. Both run on the same VPS but change the sizing: a static site gets by with the smallest tier, a database-backed application with several simultaneous visitors does not.
sudo apt install php-fpm php-mysql mariadb-server sudo mysql_secure_installation
Important: MariaDB should stay reachable only locally. In the default configuration it is. If you change that, you open the database to the internet, and that's rarely intended.
- Choose a suitable VPSStatic site small, database application larger
- Put together your own sizeThe price updates live
- Before this: set up SSH and firewallThe basis of this guide