Docs / Web Servers / How to Install Nginx on Ubuntu

How to Install Nginx on Ubuntu

By Admin · Feb 25, 2026 · Updated Apr 23, 2026 · 162 views · 1 min read

Nginx is a high-performance web server used by millions of websites.

Install

apt update
apt install nginx -y

Start and Enable

systemctl start nginx
systemctl enable nginx

Verify

Open your browser and navigate to http://YOUR_IP_ADDRESS. You should see the Nginx welcome page.

Firewall

ufw allow "Nginx Full"

Key Files

  • Config: /etc/nginx/nginx.conf
  • Sites: /etc/nginx/sites-available/
  • Logs: /var/log/nginx/
  • Web root: /var/www/html/

Test Configuration

nginx -t

Was this article helpful?