1. Download PGP key in order to pass the authentication of the nginx repository signature. click to download PGP_KEY .
after that execute the command to add PGP_KEY
$ sudo apt-key add nginx_signing.key
2. Replace the string codename with Ubuntu distribution codename etc "xenial" (Ubuntu 16.04)
$ sudo vim /etc/apt/sources.list ,append the following to the end of file
deb http://nginx.org/packages/ubuntu/ xenial nginx deb-src http://nginx.org/packages/ubuntu/ xenial nginx
3.Update software list & install nginx
$ sudo apt-get update
$ sudo apt-get install nginx
4. Startup nginx
$ sudo nginx