How-to Setup Latest Nginx Debian Apt Repo Easy Guide

Add Latest Nginx Debian Apt Repo




Hello Debian User! This Tip Shows You Step-by-Step How-to Setup Latest Nginx ‘Mainline’ Version Debian Apt Repo.

Especially relevant: the Nginx ‘Mainline’ version is generally regarded as more Reliable because of all bug fixes.

How-to Setup Latest Nginx Debian Apt Repo - Featured
  1. Login as Super User

    su -
  2. Then to Set Up the Nginx Mainline Apt Repo

    • For Debian 9

      echo "deb http://nginx.org/packages/mainline/debian/ stretch nginx" \
      | sudo tee -a /etc/apt/sources.list.d/nginx.list
      echo "deb-src http://nginx.org/packages/mainline/debian/ stretch nginx" \
      | sudo tee -a /etc/apt/sources.list.d/nginx.list
    • For Debian 8

      echo "deb http://nginx.org/packages/mainline/debian/ jessie nginx" \
      | sudo tee -a /etc/apt/sources.list.d/nginx.list
      echo "deb-src http://nginx.org/packages/mainline/debian/ jessie nginx" \
      | sudo tee -a /etc/apt/sources.list.d/nginx.list
    • For Debian 7

      echo "deb http://nginx.org/packages/mainline/debian/ wheezy nginx" \
      | sudo tee -a /etc/apt/sources.list.d/nginx.list
      echo "deb-src http://nginx.org/packages/mainline/debian/ wheezy nginx" \
      | sudo tee -a /etc/apt/sources.list.d/nginx.list
    • For Debian 6

      echo "deb http://nginx.org/packages/mainline/debian/ squeeze nginx" \
      | sudo tee -a /etc/apt/sources.list.d/nginx.list
      echo "deb-src http://nginx.org/packages/mainline/debian/ squeeze nginx" \
      | sudo tee -a /etc/apt/sources.list.d/nginx.list
  3. Add the Signing Key

    cd ~
    wget http://nginx.org/keys/nginx_signing.key
    apt-key add nginx_signing.key
    rm nginx_signing.key
  4. Next to Achieve SuperUser session

    exit