Installation of Nginx Proxy Manager on Ubuntu Using Docker

Introduction

As an IT Administrator, I understand the importance of breaking down complex tech jargon to make it accessible to everyone. Today, let’s explore Nginx Proxy Manager (NPM). It stands out as an exceptional tool for streamlining the management of reverse proxies and SSL certificates. Its user-friendly nature and ability to save valuable time and effort make it an attractive choice for many users.

What is Nginx Proxy Manager?

Nginx Proxy Manager is a powerful tool that simplifies the process of managing Nginx as a reverse proxy. But what does that mean? Imagine it as a traffic cop for web applications, directing requests to the right place. It ensures smooth communication between users and various services, enhancing security and performance.

Benefits and Features

Benefits:

  1. Simplicity: Nginx Proxy Manager provides a user-friendly interface, making it easy to configure and manage.
  2. Security: Acts as a shield, protecting your applications from direct exposure to the internet.
  3. Customization: Allows you to tailor routing rules and SSL certificates to suit your specific needs.

Features:

  1. GUI Dashboard: A graphical user interface simplifies configuration, eliminating the need for extensive command-line knowledge.
  2. Let’s Encrypt Integration: Automates the SSL certificate issuance process, enhancing security.
  3. Subdomain Management: Efficiently handles multiple applications with organized subdomains.

How to Use Nginx Proxy Manager?

Using Nginx Proxy Manager is straightforward:

  1. Installation: Start by installing Docker and Docker Compose on your Ubuntu server. (We’ll touch on this shortly.)
  2. Configuration: Access the web-based dashboard, add your services, and configure routing rules.
  3. SSL Setup: Enable secure communication with Let’s Encrypt integration.
  4. Testing: Ensure everything works smoothly by accessing your applications through the configured subdomains.

Use Cases

Nginx Proxy Manager is versatile and finds application in various scenarios:

  1. Web Application Hosting: Seamlessly host multiple web applications on a single server.
  2. API Gateway: Route API requests to the appropriate backend services.
  3. Secure Access: Provide secure access to applications without exposing them directly.

Pros and Cons

Pros:

  1. User-Friendly: The GUI makes it accessible to users with varying technical backgrounds.
  2. Robust Security: Enhances security through SSL certificate integration and proxy management.

Cons:

  1. Resource Intensive: Docker and Nginx Proxy Manager can be resource-intensive, requiring careful server planning.
  2. Learning Curve: While user-friendly, some understanding of networking concepts is beneficial.

Installation

Before embarking on the installation journey, ensure that your Ubuntu server meets the following requirements:

Prerequisites

  • Ubuntu 18.04 or a later version
  • RAM: At least 1GB.
  • Storage: 10GB of free disk space.
  • Processor: A modern multi-core processor.
  • Docker and Docker-Compose installed on the server

Installing Docker and Docker-Compose:

To install Docker and Docker-Compose, use the following script:

apt update && 
apt upgrade -y &&
curl -fsSL https://get.docker.com -o get-docker.sh &&
sudo sh get-docker.sh &&
curl -SL https://github.com/docker/compose/releases/download/v2.13.0/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose &&
chmod +x /usr/local/bin/docker-compose &&
apt-get install docker-compose-plugin

Ports

  1. Exposing Ports:Expose the necessary ports for NPM to function effectively:
    • 80:80: Used for standard HTTP traffic
    • 443:443: Dedicated for secure HTTPS traffic
    • 81:81: Serves as the administrative web interface for NPM

Crafting the Docker Compose File:

## Create a directory with any name
mkdir npm
cd npm

## Create docker compose file and paste the below code
nano docker-compose.yml
##############

version: '3.8'
services:
  app:
    image: 'jc21/nginx-proxy-manager:latest'
    restart: unless-stopped
    ports:
      - '80:80'
      - '81:81'
      - '443:443'
    volumes:
      - ./data:/data
      - ./letsencrypt:/etc/letsencrypt

#########

## Save this file
CTRL + X >> Y >> Enter

## Once the Docker Compose file is ready, execute the following command to start the NPM container:
docker-compose up -d

This command triggers the creation and execution container. The -d flag ensures that the containers run in the background, allowing you to continue working on other tasks. Access the NPM web interface by visiting the following URL: http://<server-ip>:81. Replace your-server-ip with the IP address of your server.

Creating a Reverse Proxy

To create a reverse proxy, click on the “Add Proxy Host” button.

In the “Proxy Host” field, enter the hostname of the website you want to reverse proxy.

In the “Destination” field, enter the IP address of the server that is hosting the website.

In the “Port” field, enter the port that the website is running on.

Click on the “Save” button.

Obtaining an SSL Certificate

To obtain an SSL certificate for your reverse proxy, click on the “SSL” tab.

Click on the “Add SSL Certificate” button.

In the “Domain” field, enter the hostname of the website you want to obtain an SSL certificate for.

Click on the “Request Certificate” button.

Using NPM

NPM can be used to manage a variety of tasks, including:

  • Creating and managing reverse proxies
  • Obtaining and managing SSL certificates
  • Setting up access control

Watch Video Tutorial:

Confused about setting up your own Nginx Proxy Manager? Ditch the dry guides and watch my video tutorial

  • Clear, concise instructions in Urdu/Hindi with English subtitles for everyone.
  • Visual demonstration makes every step crystal clear.
  • Time-saving guide gets you up and running fast.
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
Scroll to Top