Update the package manager unless it's already been done.
sudo apt-get update
Install the Nginx package.
sudo apt-get install nginx
If you have UFW(uncomplicated firewall) firewall installed, you'll need to allow connections to Nginx.
sudo ufw allow 'Nginx HTTP'
Verify that it worked.
sudo ufw status
You should see Nginx in the list.
You can test that it worked also by pointing a web browser to the IP or domain (and you should see 'Welcome to nginx!'.