To install Nginx on a Linux system, you can follow these steps:
Update package lists: First, update the package lists to ensure you have the latest information about available packages:
sudo apt-get updateInstall Nginx: Use the following command to install Nginx:
sudo apt-get install nginxCheck if Nginx is installed successfully: After the installation, you can verify that Nginx is installed by checking its version:
nginx -vYou should see output similar to:
nginx version: nginx/1.18.0Start Nginx: If Nginx is not already running, you can start it with:
sudo systemctl start nginxEnable Nginx to start on boot: To ensure that Nginx starts automatically when the server boots, use:
sudo systemctl enable nginxVerify Nginx is running: You can check the status of Nginx with:
sudo systemctl status nginxAccess 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.
