Install and Configure Nginx UI on Ubuntu 24.04

Nginx UI is an open-source web interface that simplifies the management and configuration of the Nginx web server. It supports both single-node and clustered environments, provides live server statistics, automatic SSL/TLS certificate handling with Let’s Encrypt, and integrates large language models (LLMs) for intelligent configuration management.

This guide explains how to install Nginx UI on Ubuntu 24.04, configure it to create and manage virtual hosts, and enable secure HTTPS connections through Let’s Encrypt.

Prerequisites

Before you begin, make sure you have:

  • Access to an Ubuntu 24.04 system with a non-root user who has sudo privileges.
  • A valid domain name pointing to your server’s public IP (e.g., nginx-ui.example.com).
  • Docker installed if you plan to deploy Nginx UI using a container.

Install Nginx UI

Nginx UI is not part of Ubuntu’s default repositories. You can install it using Docker or through the official installation script. This example uses the latest release script to set up Nginx UI as a system service.

Update Your System Packages

Install Nginx

$ sudo apt install nginx -y

Download and Install Nginx UI

Use the following commands to download and install Nginx UI.

$ curl -O https://cloud.nginxui.com/install.sh
$ sudo bash install.sh install

Verify Installation

Expected output:

nginx-ui 2.1.17 1(468) 876213ad (go1.24.5 linux/amd64)
Yet another Nginx Web UI

Start and Check the Nginx UI Service

$ sudo systemctl start nginx-ui
$ sudo systemctl status nginx-ui

Configure Nginx Reverse Proxy

By default, Nginx UI listens on port 9000 (localhost). Configure Nginx as a reverse proxy to enable public HTTPS access.

$ cd /etc/nginx/sites-available
$ sudo nano nginx-ui.conf

Insert the configuration below, replacing nginx-ui.example.com with your actual domain:


map $http_upgrade $connection_upgrade {
    default upgrade;
    ''      close;
}

server {
    listen          80;
    listen          [::]:80;

    server_name     nginx-ui.example.com;

    location / {
        proxy_set_header    Host                $host;
        proxy_set_header    X-Real-IP           $remote_addr;
        proxy_set_header    X-Forwarded-For     $proxy_add_x_forwarded_for;
        proxy_set_header    X-Forwarded-Proto   $scheme;
        proxy_http_version  1.1;
        proxy_set_header    Upgrade             $http_upgrade;
        proxy_set_header    Connection          $connection_upgrade;
        proxy_pass          http://127.0.0.1:9000;
    }    
}


$ sudo rm -f /etc/nginx/sites-enabled/default
$ sudo ln -s /etc/nginx/sites-available/nginx-ui.conf /etc/nginx/sites-enabled/
$ sudo nginx -t
$ sudo systemctl restart nginx

Secure Nginx UI with Let’s Encrypt

Install Certbot to generate and manage free TLS certificates for your domain.

$ sudo apt install certbot python3-certbot-nginx -y
$ sudo ufw allow 80,443/tcp
$ sudo ufw reload
$ sudo certbot --nginx -d nginx-ui.example.com -m admin@example.com --agree-tos --no-eff
$ sudo systemctl restart nginx-ui

Access the Nginx UI Interface

Open your browser and navigate to https://nginx-ui.example.com. Complete the setup by creating an admin account and verifying system details. The dashboard displays server metrics like uptime, memory, and network usage.

Manage TLS Certificates

Nginx UI includes automatic certificate management via Let’s Encrypt or other trusted authorities. You can import, issue, and monitor certificates, or add DNS credentials to handle wildcard domains. Under ACME User, create or manage certificate authority accounts for automatic renewals.

Create Virtual Host Configurations

To deploy a new web application, create a subdomain and corresponding directory:

$ sudo mkdir -p /var/www/app.example.com
$ sudo nano /var/www/app.example.com/index.html

Add the following HTML content:



Greetings from centron!

 


$ sudo chown -R www-data:www-data /var/www/app.example.com

Within the Nginx UI dashboard, navigate to Manage SitesAdd Site to create the virtual host, enable TLS, and issue a Let’s Encrypt certificate automatically. Once completed, access your app at:

https://app.example.com

Conclusion

In this tutorial, you learned how to install and configure Nginx UI on Ubuntu 24.04. With Nginx UI, you can efficiently manage users, monitor performance, automate SSL management, and even integrate with LLMs for configuration assistance. For advanced usage and documentation, visit the official Nginx UI site.

Source: vultr.com

Create a Free Account

Register now and get access to our Cloud Services.

Posts you might be interested in: