How to Install NGINX on Linux Mint 21


Nginx is an open-source and free software coded in C language. It packs many impressive features, such as reverse proxying, load balancing, web serving, streaming, and more. You can also use this as a web server because it can handle multiple clients simultaneously. Nginx server is known for reducing the page load times

Today’s article is about Nginx’s step-by-step installation and configuration on Linux Mint 21, but before moving forward, one should know the features of Nginx.

Features of Nginx

The Nginx supports the following feature set

  • Reverse Proxy with Caching
  • Basic HTTP authentication
  • SSL
  • WebSockets and load balancing
  • Auto indexing
  • Handle static and index files
  • FastCGI with caching

How to Install NGINX on Linux Mint 21

The installation of the Nginx on Linux Mint 21 requires you to have,

  • Basic Knowledge of Linux OS and Terminal
  • An internet connection
  • Root Access

Once you are ready, let’s move on to the installation process

Step 1: Get root access.

$ sudo -i

Type the following command followed by your password, and then press the “Enter: key in the terminal to become root

install-Nginx-Linux-Mint-21

Step 2: Update the system’s packages

To update your system’s packages, use the following command in the terminal, and you are recommended to use this before installing any package in any of the Linux distros.

This process requires a few minutes or seconds to complete.

$ sudo apt-get update

Step 3: Install Nginx from the official Repository

$ sudo apt-get install nginx

Nginx is a part of official repositories, and to install Nginx on Linux Mint 21, use the following command in the terminal.

Now type ‘Y’ and press the “Enter key” to start the installation process.

install-Nginx-Linux-Mint-21

Once done, it will automatically download and install Nginx on your system.

install-Nginx-Linux-Mint-21

Step 4: Start Nginx

$ sudo systemctl start nginx 

The Nginx requires the following command to be used to start.

install-Nginx-Linux-Mint-21

It won’t display any message or error, which means the command worked.

Step 5: Verify Nginx

$ nginx -v

To verify is Nginx is installed or not, the following command requires execution to show its version of it.

install-Nginx-Linux-Mint-21

Step 6: Allow Traffic for Nginx on Port 80

$ sudo ufw allow 'Nginx HTTP'

You must execute the following command to allow all traffic from anywhere on Port 80.

Once the above command is executed, you will see that “Rules updated,” which means all traffic was allowed.

install-Nginx-Linux-Mint-21

$ sudo ufw status

To check if it is allowed on Port 80 or not, execute the following command in the terminal.

install-Nginx-Linux-Mint-21

$ sudo ufw enable

Execute the following command to enable the firewall if it is disabled.

install-Nginx-Linux-Mint-21

Step 7: Testing the working of Nginx

http://your- assigned-ip-address

Testing the Nginx requires you to open your browser and enter the following website in the address bar.

install-Nginx-Linux-Mint-21

Or you can use https://127.0.0.1

How to check IP Address in Linux Mint 21

$ ifconfig

You can check your assigned IP address multiple times, but the following command will do the trick.

And here is the output where “inet” is your IP address.

install-Nginx-Linux-Mint-21

Conclusion

Today’s article was about installing Nginx on Linux Mint 21, open-source and free software mainly used for reverse proxying and several other related functions, as discussed above.

Linux Mint 21 was used to perform the step-by-step installation and a few needed configurations before you pave your way through it.

Print Friendly, PDF & Email
Categories