Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

Forums

Nginx Latest stable version installation Guide

Scheduled Pinned Locked Moved General Discussion
nginx
8 Posts 5 Posters 190 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    weusi
    wrote on last edited by
    #1

    Ubuntu

    Install the prerequisites:

    sudo apt install curl gnupg2 ca-certificates lsb-release
    

    To set up the apt repository for stable nginx packages, run the following command:

    echo "deb http://nginx.org/packages/ubuntu `lsb_release -cs` nginx" \
        | sudo tee /etc/apt/sources.list.d/nginx.list
    

    If you would like to use mainline nginx packages, run the following command instead:

    echo "deb http://nginx.org/packages/mainline/ubuntu `lsb_release -cs` nginx" \
        | sudo tee /etc/apt/sources.list.d/nginx.list
    

    Set up repository pinning to prefer our packages over distribution-provided ones:

    echo -e "Package: *\nPin: origin nginx.org\nPin: release o=nginx\nPin-Priority: 900\n" \
        | sudo tee /etc/apt/preferences.d/99nginx
    

    Next, import an official nginx signing key so apt could verify the packages authenticity. Fetch the key:

    curl -o /tmp/nginx_signing.key https://nginx.org/keys/nginx_signing.key
    Verify that the downloaded file contains the proper key:
    
    gpg --dry-run --quiet --import --import-options show-only /tmp/nginx_signing.key
    

    Note: on Ubuntu 16.04, use the following command instead:

    gpg --with-fingerprint /tmp/nginx_signing.key
    

    The output should contain the full fingerprint 573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62 as follows:

    pub   rsa2048 2011-08-19 [SC] [expires: 2024-06-14]
          573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62
    uid                      nginx signing key <signing-key@nginx.com>
    

    Finally, move the key to apt trusted key storage (note the "asc" file extension change):

    sudo mv /tmp/nginx_signing.key /etc/apt/trusted.gpg.d/nginx_signing.asc
    

    To install nginx, run the following commands:

    sudo apt update
    sudo apt install nginx
    
    bughunterx27B 1 Reply Last reply
    1
    • claudC Offline
      claudC Offline
      claud
      wrote on last edited by claud
      #2

      This is a very good post, i used it in my ubuntu 22 and it works very well

      1 Reply Last reply
      2
      • EthanE Offline
        EthanE Offline
        Ethan
        wrote on last edited by
        #3

        Really ??

        claudC 1 Reply Last reply
        0
        • claudC Offline
          claudC Offline
          claud
          replied to Ethan on last edited by
          #4

          @Ethan this is a repry

          1 Reply Last reply
          0
          • EthanE Offline
            EthanE Offline
            Ethan
            wrote on last edited by
            #5

            Mbona reply

            1 Reply Last reply
            0
            • bughunterx27B Offline
              bughunterx27B Offline
              bughunterx27
              replied to weusi on last edited by
              #6

              @weusi Very nice contents

              1 Reply Last reply
              0
              • claudC Offline
                claudC Offline
                claud
                wrote on last edited by claud
                #7

                hello there this is some markdown

                  ```
                

                print hello

                1 Reply Last reply
                0
                • G Offline
                  G Offline
                  gideon
                  wrote on last edited by
                  #8

                  Such nice stuff

                  1 Reply Last reply
                  0

                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups