Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save mehrdad-shokri/52e4084a804b48efe575987ec9038700 to your computer and use it in GitHub Desktop.
Save mehrdad-shokri/52e4084a804b48efe575987ec9038700 to your computer and use it in GitHub Desktop.
Install Nginx Mainline / Stable on Ubuntu 16.04
#!/bin/bash
# https://www.nginx.com/resources/wiki/start/topics/tutorials/install/
# Switch to root
sudo su
# Add the mainline release
echo "deb http://nginx.org/packages/mainline/ubuntu/ xenial nginx
deb-src http://nginx.org/packages/mainline/ubuntu/ xenial nginx" > /etc/apt/sources.list.d/nginx.list
# Or add the stable release
#echo "deb http://nginx.org/packages/ubuntu/ xenial nginx
#deb-src http://nginx.org/packages/ubuntu/ xenial nginx" > /etc/apt/sources.list.d/nginx.list
# Install the packages
apt-get -y update
apt-get -y install nginx
# Check the Nginx version
nginx -v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment