sudo. The server’s IP and root access come from the VPS card in the @lumivps_bot bot.
Installing Nginx
How the configs are organized
Sites in Nginx on Ubuntu/Debian are described by separate files:/etc/nginx/sites-available/— this is where the configs for all sites live;/etc/nginx/sites-enabled/— a symlink to the active ones goes here.
sites-available and then “enable” it with a symlink in sites-enabled.
Always run
nginx -t before reload. If there’s an error in the config, reload won’t apply it and Nginx will keep running on the old configuration — the site won’t go down.A simple static site
Create a directory for the site’s files and put anindex.html in it:
/etc/nginx/sites-available/site:
/etc/nginx/sites-available/site
Add PHP
For Nginx to handle.php (WordPress, scripts, etc.), you need PHP-FPM:
Add a PHP handler to the site config
The socket path depends on the PHP version. The package creates a versioned socket; the unversioned You’ll see something like
/run/php/php-fpm.sock doesn’t exist — nginx will fail with a 502. First check which sockets you have:php8.3-fpm.sock. Substitute the exact name in the config below.location block for .php inside server { ... }:HTTPS
A site onhttp:// is worth securing with a certificate so that https:// works. The certificate is installed separately — for free via Let’s Encrypt, automated by the certbot tool. The full walkthrough is on a separate page:
SSL certificate (Let's Encrypt)
How to issue a certificate for free and enable HTTPS with auto-renewal.
apt install apache2); the principles are the same, but the configs and syntax differ.
Where to next
SSL certificate
Free HTTPS via Let’s Encrypt with auto-renewal.
Firewall
Open ports 80 and 443 for web traffic.