[Updated on Date: 2021-01-21] As an administrator of high-traffic websites, you need a high-performance web server. Nginx is an open-source and popular web server with global fame. Also, you can use it as a reverse proxy. In this article, you will learn How To Install Nginx on Ubuntu 20.04 LTS. In case you are not sure to purchase a Linux VPS, our perfect packages would be satisfying. Either you can buy your own Ubuntu VPS and continue learning this guide.
To let this tutorial work better, please consider the below Prerequisites:
A non-root user with sudo privileges.
To set up, follow our Initial server setup on Ubuntu 20.04.
Table of Contents
Install Nginx on Ubuntu 20.04 | Ubuntu 18.04
Nginx has been released under the 2-clause BSD License and you can install to on your Ubuntu server in about 20 minutes. Nginx is available in Ubuntu’s default repositories. So, you can install the repositories by apt packaging system. Let’s go through the steps of this guide to learn and finish it.
Step 1: Install Nginx
First, you should update the local package with the below command:
sudo apt update
Then install Nginx with the command below:
sudo apt install nginx
Step 2: Adjusting the Firewall on ubuntu 20.04
First, you need to enable the UFW firewall. Then Check the available UFW firewall application profiles with the command below:
sudo ufw app list
Output:
Available applications: Nginx Full Nginx HTTP Nginx HTTPS OpenSSH
Now enable permitting traffic on port 80:
sudo ufw allow 'Nginx HTTP'
You should Verify the change:
sudo ufw status
Step 3: Check Web Server
Check to see if the webserver is running:
systemctl status nginx
Then you should check Access the default Nginx landing page in the browser with the command below:
http://your_server_ip
After entering the IP address on the browser, you should see the default Nginx landing page:
Conclusion
In this article, you learned How To Install Nginx on Ubuntu 20.04. From now on, you can configure PHP, Python, Perl, and Ruby apps or install TLS, SSL certificates to secure traffic. In case you are interested in reading more, find our related article on How to install Nginx on Debian 10.