Green YGreck Guides FR
🐧 LinuxIntermediate⏱ 20 min6 steps

Install nginx and publish a static site

A web server in a few minutes on Debian or Ubuntu.

  1. Installation:
    sudo apt update
    sudo apt install nginx
  2. Public files go in /var/www/html: replace index.nginx-debian.html with your index.html.
  3. Check the configuration then reload:
    sudo nginx -t
    sudo systemctl reload nginx
  4. Open the firewall if UFW is active:
    sudo ufw allow 'Nginx Full'
  5. For free HTTPS, use Certbot (Let's Encrypt) once your domain name points to the server.
  6. Logs in case of trouble:
    sudo tail -f /var/log/nginx/error.log