Step-by-step guideline to installation of Nginx on Ubuntu

Chinmay Roy
2 min readMay 7, 2024

--

In this article, I will teach you to installation of Nginx on your Ubuntu machine. Let’s start:

Update Package Lists: It’s always a good idea to start by updating the package lists to ensure you’re installing the latest versions of software.

sudo apt update
  1. Install Nginx: You can install Nginx from the default Ubuntu repositories using the following command:
sudo apt install nginx

2. Start Nginx: After installation, Nginx should start automatically. If it doesn’t, you can start it manually using:

sudo systemctl start nginx

3. Enable Nginx to Start on Boot: To ensure that Nginx starts automatically every time the system boots up, you can enable it as a systemd service:

sudo systemctl enable nginx

4. Check Nginx Status: You can verify that Nginx is running by checking its status:

sudo systemctl status nginx

Carefully apply this portion:

  1. Adjust Firewall: If you have a firewall enabled, such as UFW, you’ll need to allow traffic on the default HTTP (port 80) and HTTPS (port 443) ports. If UFW is enabled, you can allow Nginx HTTP and HTTPS connections with:
sudo ufw allow 'Nginx Full'

This command will allow traffic to ports 80 (HTTP) and 443 (HTTPS).

Verify Installation: You can now open a web browser and enter your server’s IP address. If Nginx is installed correctly, you should see the default Nginx welcome page.

That’s it! Nginx is now installed and running on your Ubuntu local or live server. You can further configure Nginx to host websites or proxy requests to other services as needed. If you encounter any issues during installation or configuration, feel free to ask for assistance!.

--

--