How to Install Nginx on Ubuntu 16.04 LTS


  1. Prerequisites

    • Ubuntu 12.04, 14.04, 16.04
    • root privileges
    • few knowledge using vim

    Step 1 Install some Debian package development tools and library

    sudo apt-get install dpkg-dev build-essential zlib1g-dev libpcre3 libpcre3-dev unzip

    Step 2 Adding nginx repo

    sudo nano /etc/apt/sources.list.d/nginx.list

    Paste in two string

    For 12.04:

    deb precise nginx
    deb-src precise nginx

    For 14.04:

    deb trusty nginx 
    deb-src trusty nginx

    For 16.04:

    deb xenial nginx 
    deb-src xenial nginx

    After that update

     sudo apt-get update

    Command stop and show strings like that:

    GPG error: <name package> Release: The following signatures couldn’t be verified because the public key is not available: NOPUBKEY ABF5BD8xxxxxxx

    Don’t worry add this key

    wget -q "" -O-| sudo apt-key add -


    sudo apt-get update

Partner Sites

Be the first to comment

Leave a Reply

Your email address will not be published.