How to install Nginx?

To install Nginx on a Linux system, you can follow these steps:

  1. Update package lists: First, update the package lists to ensure you have the latest information about available packages:

    sudo apt-get update
  2. Install Nginx: Use the following command to install Nginx:

    sudo apt-get install nginx
  3. Check if Nginx is installed successfully: After the installation, you can verify that Nginx is installed by checking its version:

    nginx -v

    You should see output similar to:

    nginx version: nginx/1.18.0
  4. Start Nginx: If Nginx is not already running, you can start it with:

    sudo systemctl start nginx
  5. Enable Nginx to start on boot: To ensure that Nginx starts automatically when the server boots, use:

    sudo systemctl enable nginx
  6. Verify Nginx is running: You can check the status of Nginx with:

    sudo systemctl status nginx
  7. Access Nginx: Open a web browser and enter your server's IP address. You should see the default Nginx welcome page.

That's it! You have successfully installed Nginx on your system.

0 Comments

no data
Be the first to share your comment!