Publish your first page on a VPS

2 min read07 November 2026

A bare VPS serves no page: you need a web server, a file and an open port. Nginx is a common choice on Debian, light and simple to configure. The goal here is a static page genuinely reachable over the IPv6 address and, if you have one, over IPv4, without any domain name.

Install Nginx

Bash
sudo apt update
sudo apt install -y nginx
sudo systemctl status nginx

The package starts the service and enables it at boot. systemctl status nginx should show active (running). If it fails, read journalctl -u nginx before changing the configuration.

Create the page and document root

Bash
sudo mkdir -p /var/www/votre-domaine.fr
sudo chown -R www-data:www-data /var/www/votre-domaine.fr
sudo chmod 755 /var/www/votre-domaine.fr

Then create /var/www/votre-domaine.fr/index.html with minimal content and set the file mode to 644. Never use chmod 777: the web server only needs to read. The www-data owner lets Nginx serve files without making them writable by everyone.

Declare the site

Create /etc/nginx/sites-available/votre-domaine.fr:

Nginx
server {
    listen 80;
    listen [::]:80;
    server_name votre-domaine.fr www.votre-domaine.fr;

    root /var/www/votre-domaine.fr;
    index index.html;

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

Enable it with a symlink, then validate before reloading:

Bash
sudo ln -s /etc/nginx/sites-available/votre-domaine.fr /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx

nginx -t must report syntax is ok and test is successful. A reload fails cleanly without dropping the running service; a restart drops current connections.

Open port 80

Bash
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw status verbose

Allow SSH before enabling UFW, or you lose remote access. Rules must appear for both IPv4 and IPv6. If another firewall is active, adapt that command instead of stacking two systems.

Test over IPv6 and IPv4

Bash
curl -I http://[VOTRE_IPV6]/
curl -4 -I http://VOTRE_IPV4/

Brackets are mandatory in an IPv6 URL. Both requests must return HTTP/1.1 200 OK. If IPv6 works and IPv4 does not, check the address and firewall. From a browser, use the IPv6 test page to confirm the network path. A page reachable by IP but not by name points to DNS, not Nginx.

Quick troubleshooting

  • The default Nginx page still appears: check that the symbolic link exists in sites-enabled and that server_name matches the name you used, then reload Nginx.
  • 403 error: the root directory permissions or owner prevent reading. Set the directory back to 755 and the file to 644.
  • Connection refused: port 80 is not open in the firewall, or Nginx is not listening. Check ss -lntp | grep :80 and ufw status.
  • The page works locally but not from the internet: open the IPv6 address in a browser and confirm the service also listens on [::]:80.

Advertisement

Was this article helpful?

Read next