Connect to the machine running Ubuntu via SSH.
Ensure that the operating system is fully current:
sudo apt update && sudo apt upgrade
sudo apt-get install nginx
Nginx will start automatically at the end of the installation process. To test that Nginx has been correctly installed, type the IP address of the machine running Ubuntu into your browser. You should see the default Nginx page.