How to Install Nginx in Ubuntu

I. Introduction

These series of bash commands will install NGINX in your Ubuntu machine. 

Tested on Ubuntu version 2.0.04.

II. Bash Script

sudo cp -r /etc/nginx /etc/nginx.backup
sudo apt-get remove --purge 'nginx*'
sudo apt install curl gnupg2 ca-certificates lsb-release
echo "deb http://nginx.org/packages/ubuntu `lsb_release -cs` nginx" | sudo tee /etc/apt/sources.list.d/nginx.list
# echo "deb http://nginx.org/packages/mainline/ubuntu `lsb_release -cs` nginx" | sudo tee /etc/apt/sources.list.d/nginx.list
curl -fsSL https://nginx.org/keys/nginx_signing.key | sudo apt-key add -
sudo apt-key fingerprint ABF5BD827BD9BF62
sudo apt update
sudo apt-get install nginx-module-njs nginx

Reference:

  • http://nginx.org/en/linux_packages.html#Ubuntu

0 Comments

Post a Comment

Post a Comment (0)

Previous Post Next Post
NERV Open Source

Building production Spring Boot systems?

Explore NERV — open-source Java libraries for audit trails, persistence, exception handling, and reliable event-driven architecture.

Explore NERV on GitHub →