Installation on Ubuntu
sudo apt install -y nginx installs Nginx and registers the nginx systemd service, started automatically on port 80. Visit http://localhost to see the default welcome page served from /var/www/html.
The sites-available pattern
Debian/Ubuntu split virtual hosts into /etc/nginx/sites-available (definitions) and /etc/nginx/sites-enabled (active symlinks). Enable a site with sudo ln -s /etc/nginx/sites-available/foo /etc/nginx/sites-enabled/, then reload.
Validate before reloading
Always run sudo nginx -t to check syntax, then apply with sudo systemctl reload nginx (a reload re-reads the config without dropping live connections).