1. Prerequisites

In order to install Nginx on Ubuntu, you must have root or sudo privileged user access to your system. For the remote systems can use ssh command or putty for Windows user to login.

2. Install Nginx on Ubuntu

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.

3. Configure Firewall

You need to open the firewall port to access Nginx server from remote systems. The following command will allow port 80 (HTTP) and port 443 (HTTPS) on your system. You don’t need to open both ports. Use one of the following commands to open specific ports.

4. Manage Nginx Service

The systemd users use systemctl commands to manage their Nginx service on Ubuntu system. The below commands will stop, star, and restart nginx service.