← Help center · VPS and servers
How to install Nginx on Ubuntu
Nginx is a fast web server used by many busy sites.
Install
apt update
apt install nginx -y
systemctl enable --now nginx
Test
Open http://YOUR-SERVER-IP in a browser. You should see "Welcome to nginx".
Where files go
- Default website folder:
/var/www/html - Site settings:
/etc/nginx/sites-available/
After a change, test and reload:
nginx -t && systemctl reload nginx
Remember to open ports 80 and 443 in your firewall. To add PHP and a database, see install a LAMP stack. Add https with a free certificate from Let's Encrypt or a paid SSL.
More in VPS and servers
- How to connect to your Linux VPS with PuTTY (Windows)
- How to connect to a Linux VPS from Mac or Linux with SSH
- Where to find your server IP address and password
- How to change your root password on Linux
- First steps on a new Linux VPS: a security checklist
Still stuck? Open a support ticket.