Connect to the machine running Ubuntu 18.04 via SSH.
Ensure that the operating system is fully current:
sudo apt update && sudo apt upgrade
sudo apt 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 18.04 into your browser. You should see the default Nginx page.