Update the packages:

sudo apt update

Install Nginx:

sudo apt install nginx

Start the service:

sudo systemctl start nginx

Open your browser and go to http://localhost or your server’s IP address.

If you see the Nginx welcome page, the installation was successful.