How to install Nginx on Ubuntu 18

This post will guide you how to install Nginx on Ubuntu 18.04 but this can apply to Ubuntu 16.04 also.

In the series about Nginx:

Step 1: Adding repo

Run this command to add repo to Ubuntu

vi /etc/apt/sources.list

add these lines at the bottom of this file

deb http://nginx.org/packages/mainline/ubuntu/ bionic nginx

run these commands to add signing keys

sudo wget http://nginx.org/keys/nginx_signing.key
sudo apt-key add nginx_signing.key

Step 2: Install Nginx

Run these commands to install

sudo apt update
sudo apt install nginx

Run these commands to setup Nginx

sudo systemctl start nginx
sudo systemctl enable nginx
Related:  Nginx Reverse Proxy settings

3 thoughts on “How to install Nginx on Ubuntu 18”

Leave a Reply

Your email address will not be published. Required fields are marked *