This tutorial will help you to install and configure Nginx web server on Ubuntu 20.04 system.


Running Ubuntu 20.04 system Shell access with root or sudo privileged user

Step 1 – Installing Nginx

The Nginx latest packages are available under default repositories for all Ubuntu’s versions. You can directly install them by running following commands After installation of Nginx service, run below command to check the status of Nginx service.

Step 2 – Nginx Configuration Files and Directories

Here is the list of configuration file and directories used by the Nginx web server.

Step 3 – Manage Nginx Service

The systemd users uses systemctl commands to manage services on Ubuntu system. You can also use the same for managing the Nginx service on your system. Use below commands will stop, start, and restart Nginx service with systemd.

Step 4 – Adjust Firewall Rules

The FirewallD is the popular firewall application used on Ubuntu systems. Some of the Ubuntu users also preferred to use Uncomplicated Firewall (UFW) on their system. FirewallD users use the following command to open HTTP (80) and HTTPS (443) ports. Reload the firewall changes by running the following command:

Step 5 – Test Setup

Connect to your server using localhost or use IP address for remote systems in a web browser. This will show you the default Nginx page.


In this tutorial, you have learned about the installation of Nginx web server.

How to Install Nginx on Ubuntu 20 04   TecAdmin - 21