Install NGINX on Ubuntu 22.04


Installation of NGINX in Ubuntu 22.04, you first need to type sudo apt update and then type sudo apt install nginx command on the terminal, this command will install NGINX in your Ubuntu 22.04 system; Through this tutorial, we will show you step-by-step process of NGINX installation on Linux ubuntu 22.04.

How to Install NGINX on Ubuntu 22.04

Here are the steps to install, configure, and verify NGINX on Linux Ubuntu 22.04 or 20.04:

Step 1 – Open Terminal OR Command Line

First, Open the terminal or command line application by pressing Ctrl+Alt+T.

Step 2 – Update APT Packages

Then update apt packages by using the following command:


sudo apt update

Step 3 – Install NGINX on Ubuntu 22.04 | 20.04

Next, type this command on terminal to install nginx:

sudo apt install NGINX

Step 4 – Verify NGINX Installation Ubuntu

Once the installation of NGINX on linux ubuntu system has been done; then execute the following command on command line to verify NGINX installation:


sudo systemctl status NGINX

Step 5 – Configure Firewall For NGINX

NGINX server from various HTTP and non-HTTP web servers on port 443, 80, or both of these ports. So use the following commands to configure firewall for NGINX for linux ubuntu system:

sudo ufw allow 'NGINX Full'

Step 6 – Test Installation in Browser

Then open web browser and hit the following url with ip address to test NGINX installation:



Step 7 – Configure NGINX Server

Configure NGINX server for it to restart after system reboots:

sudo systemctl enable NGINX

Use the following additional commands to check the status of the NGINX server, in addition to restarting it, reloading it, starting it, stopping it, and disabling it from starting every time the system boots up.


Check NGINX Status

sudo systemctl status NGINX

Restart NGINX

sudo systemctl restart NGINX

Reload NGINX

sudo systemctl reload NGINX


sudo systemctl start NGINX


sudo systemctl stop NGINX

Disable NGINX

sudo systemctl disable NGINX

Step 8 – Uninstall Nginx on Ubuntu 20.0|22.04 Linux(Optional)

Sometimes, you may need to remove or uninstall NGINX Server in linux ubuntu system. You can do it by following commands:


sudo apt-get purge NGINX
sudo apt-get autoremove

Here is the video tutorial of nginx installation on ubuntu system:


Through this tutorial, you have learned the complete process of nginx installation on Ubuntu 22.04.

After all, this is related to the tutorial, if you have any questions, you can comment on comment box, or mail me at [email protected].

Recommended Linux Ubuntu Tutorials


Jaspreet Singh Ghuman

Jaspreet Singh Ghuman

Passionate Professional Blogger, Freelancer, WordPress Enthusiast, Digital Marketer, Web Developer, Server Operator, Networking Expert. Empowering online presence with diverse skills.

jassweb logo

Jassweb always keeps its services up-to-date with the latest trends in the market, providing its customers all over the world with high-end and easily extensible internet, intranet, and extranet products.


Jassweb, Rai Chak, Punjab, India. 143518
Item added to cart.
0 items - 0.00