Self-host Nginx UI on a managed VPS, with a private panel

To self-host Nginx UI on a managed VPS is to manage Nginx from your browser, on a server which our teams keep up to date and monitor day and night. Nginx UI is an open source web interface for Nginx under the AGPL-3.0 license, with a configuration editor, certificates, logs and backups. A panel that writes the configuration of a web server deserves care, so this guide creates the administrator before anything is reachable and keeps the panel off the Internet. It follows the official Docker image at version v3.0.9, and we tested it on a Simafri VPS before writing it: installation, HTTPS, a first site, backup, restore and update.

Simon Vasconcelos Lee By Published on 6 December 202610 minute read

All guides Development and DevOps

In short

  1. The official image uozi/nginx-ui contains both Nginx and its interface: Nginx UI manages the Nginx inside its container.
  2. Create the administrator from environment variables at the first start, so that the installation page is closed before you connect.
  3. Publish the panel on 127.0.0.1 only, serve it over HTTPS from its own Nginx, and reach it through an SSH tunnel.
  4. Leave the Docker socket out: you only need it to control another container or to update from the panel.
  5. Back up the data folder with the container stopped, then update by changing the image tag.

What Nginx UI does

Nginx UI is written in Go and Vue and distributed as a single binary, or as a Docker image built on the official Nginx image. It reads and writes standard Nginx files, in the sites-available and sites-enabled layout of Debian.

What the AGPL-3.0 license allows

Nginx UI is published under the GNU Affero General Public License v3.0. You can run it free of charge, for your company or your clients, study it and modify it. If you modify it and let people use your version over a network, you must offer them its source code. The software comes without warranty.

The resources to plan for

Here is what we measured on our test VPS, with one site:

The smallest size is enough to start: a Simafri Managed VPS Pro 1, with 1 vCPU, 2 GB of memory and 20 GB of NVMe storage, at US$19.99 per month excl. tax. Move up when the sites behind Nginx need it.

Installing with Docker Compose

The official image can replace the Nginx of a server by taking its ports 80 and 443. Here it stays in its container, on local ports, so it can live beside a web server that is already running. On a server with Docker Engine and its Compose plugin, create the folder /opt/nginx-ui:

Terminal
mkdir -p /opt/nginx-ui

Put this compose.yaml in it:

compose.yaml
services:
  nginx-ui:
    image: uozi/nginx-ui:v3.0.9
    restart: unless-stopped
    environment:
      NGINX_UI_SERVER_RUN_MODE: release
      NGINX_UI_IGNORE_DOCKER_SOCKET: "true"
      NGINX_UI_NODE_SKIP_INSTALLATION: "true"
      NGINX_UI_PREDEFINED_USER_NAME: admin
      NGINX_UI_PREDEFINED_USER_PASSWORD: ${ADMIN_PASSWORD:?set ADMIN_PASSWORD in .env}
    ports:
      - "127.0.0.1:8130:80"
      - "127.0.0.1:8131:8081"
      - "127.0.0.1:8443:443"
    volumes:
      - ./data/nginx:/etc/nginx
      - ./data/nginx-ui:/etc/nginx-ui
      - ./data/www:/var/www

Generate the administrator’s password in a file readable by root only, then start the container, from /opt/nginx-ui:

Terminal, in /opt/nginx-ui
umask 077
printf "ADMIN_PASSWORD=%s\n" "$(openssl rand -hex 16)" > .env
umask 022
docker compose up -d
timeout 60 sh -c "until curl -fsS -o /dev/null http://127.0.0.1:8130/; do sleep 2; done"
curl -s http://127.0.0.1:8130/api/install

The last command returns {"lock":true,"timeout":false}: the installation is already closed, and nobody can claim the administrator account.

HTTPS, without exposing the panel

Nginx UI can edit configuration files and open a terminal in its container: we recommend keeping it private. Its own Nginx can serve it over HTTPS with a certificate created on the server. Once the first start has filled the folder, create that certificate:

Terminal, in /opt/nginx-ui
mkdir -p data/nginx/ssl/panel
openssl req -x509 -newkey ec -pkeyopt ec_paramgen_curve:P-256 -nodes -days 825 -subj "/CN=localhost" -addext "subjectAltName=DNS:localhost,IP:127.0.0.1" -keyout data/nginx/ssl/panel/key.pem -out data/nginx/ssl/panel/cert.pem
chmod 600 data/nginx/ssl/panel/key.pem

Then add this file, which reuses the WebSocket setting of the bundled configuration:

data/nginx/conf.d/panel-https.conf
server {
    listen 443 ssl;
    server_name localhost;
    ssl_certificate /etc/nginx/ssl/panel/cert.pem;
    ssl_certificate_key /etc/nginx/ssl/panel/key.pem;

    location / {
        proxy_set_header Host $http_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 https;
        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/;
    }
}
Terminal, in /opt/nginx-ui
docker compose restart
timeout 60 sh -c "until curl -fs -o /dev/null --cacert data/nginx/ssl/panel/cert.pem https://localhost:8443/; do sleep 2; done"
docker compose exec -T nginx-ui nginx -t
curl -sI --cacert data/nginx/ssl/panel/cert.pem https://localhost:8443/

The test says the configuration is successful, and the panel answers HTTP/1.1 200 OK with a verified certificate. From your own computer, open a tunnel with the address of your server:

Terminal, on your computer
ssh -N -L 8443:127.0.0.1:8443 root@server.example.com

While it runs, https://localhost:8443 in your browser opens the panel. The browser warns about the certificate, which you signed yourself: accept it for this address, or import cert.pem on your computer. On our test VPS, the panel answered through the tunnel, while its port listened on 127.0.0.1 only.

The first sign-in

  1. Read the password in /opt/nginx-ui/.env, as root.
  2. Open https://localhost:8443 through the tunnel and sign in as admin: the dashboard opens.
  3. In User Profile, change the password and turn on two-factor authentication or a passkey.

On our test VPS, a request to the sites API without a session was refused with a 403. Keep the number of accounts small: whoever can write the Nginx configuration decides what the server serves and where it forwards requests.

A first site

Files placed in data/www appear under /var/www in the container. Create a test page:

Terminal, in /opt/nginx-ui
mkdir -p data/www/demo
echo "<h1>Served by Nginx UI</h1>" > data/www/demo/index.html

In Manage Sites, Add Site, choose Advanced, name the site demo, paste this configuration, save it and enable it:

Site configuration
server {
    listen 8081;
    server_name demo.example.com;
    root /var/www/demo;
    index index.html;
}

Nginx UI tests the configuration and reloads Nginx. The site answers on its local port:

Terminal, on the server
curl -s -H "Host: demo.example.com" http://127.0.0.1:8131/

To publish such a site, point the reverse proxy of your server to 127.0.0.1:8131, keeping the Host header. On a server with no other web server, the project also documents giving ports 80 and 443 to the container: if you do, give the sites their own server blocks and keep the panel’s out of public reach, since the bundled configuration serves it on port 80.

Backups

Everything lives in data: the Nginx files, the database and settings of Nginx UI, its plugins and your websites. Together with compose.yaml and .env, that is the whole installation. Stop the container during the copy, so that the SQLite database is consistent, and create the archive readable by root only, since it holds keys and accounts:

Terminal, in /opt/nginx-ui
(
  umask 077
  docker compose stop nginx-ui &&
  tar czf nginx-ui-$(date +%F).tar.gz compose.yaml .env data
  docker compose start nginx-ui
)

Send the archive off the server. The interface also has encrypted configuration backups, under Backup Manage, whose key you must keep with them.

Restoring

Stop the container, remove the current data folder, extract the archive with its owners and permissions, then start again:

Terminal, in /opt/nginx-ui
BACKUP_DATE=2026-12-06
(
  set -e
  for f in nginx-ui-$BACKUP_DATE.tar.gz; do
    test -s "$f" || { echo "Missing or empty: $f"; exit 1; }
  done
  docker compose down
  rm -rf /opt/nginx-ui/data
  tar xzpf nginx-ui-$BACKUP_DATE.tar.gz --numeric-owner
  docker compose up -d
)

Set BACKUP_DATE, on the first line, to the date in the names of the backup you restore, as listed by ls. The commands run in parentheses with set -e, which stops them at the first error. They first check that each file exists and is not empty, before anything is stopped, removed or overwritten: a wrong date stops there, with your data untouched, and a failed step stops every step after it, so the application is never started again on a partial restore.

We tested the cycle on our VPS: archive, a site added after it, the folder deleted, restore. The account, the HTTPS panel and the demo site came back, and the site added after the archive was gone.

Updates

Nginx UI publishes releases and security advisories often, and its image also carries Nginx: an update is how both get their fixes. Read the release notes, take a backup, change the tag, then recreate the container:

Terminal, in /opt/nginx-ui
sed -i "s|image: uozi/nginx-ui:v3.0.8|image: uozi/nginx-ui:v3.0.9|" compose.yaml
docker compose pull
docker compose up -d
docker compose exec -T nginx-ui nginx -v
docker compose exec -T nginx-ui nginx-ui --version

Who does what on a managed VPS

Self-hosting means running the server on top of the application. On a managed VPS, our teams take charge of the server and proactively monitor your instance; Nginx UI remains your software, with your sites and your configuration.

TopicOur teamsYou
The serverSystem and security updates, server interventions includedThe timing that suits you
MonitoringServer monitored 24/7, with intervention without waiting for your callThe sites you declare in Nginx UI
Nginx UIProactive monitoring: errors, slowdowns and disk space spotted, fix recommendedIts installation, updates and settings, which you apply, yourself or through your AI assistant
AccessThe server that carries the panel, monitored and backed upAccounts, two-factor authentication and SSH keys
BackupsEvery night, encrypted and kept off the machine; restores includedYour own archives, and the restore request, when you need one
MigrationYour current server migrated, free of chargeThe timing of the switch

If you would rather have our teams work inside the application itself, that service is billed by the hour or at a fixed rate, with an estimate shared before the work starts.

Nginx UI, on a server run for you

With a Simafri Managed VPS, our teams keep the server of your Nginx UI up to date, monitor it day and night and step in without waiting for your call; they also proactively monitor your instance and recommend useful fixes, which you apply, yourself or through your AI assistant. Backups are encrypted every night and kept off the machine, restores are included, and migrating your current server is free.

Explore Managed VPS

Frequently asked questions

Is Nginx UI free?

Yes. Nginx UI is under the AGPL-3.0 license: you can run it for your company or your clients with no license to buy. What remains is the cost of the server that runs it.

What is the default Nginx UI login?

A new installation has none: it asks for a one-time secret stored in .install_secret. With this guide, the admin account is created at the first start from the password you put in .env, and the installation page is closed before you connect.

Can Nginx UI run next to Caddy or another web server?

Yes. Publish the ports of the container on 127.0.0.1, as in this guide: ports 80 and 443 of the server stay with the web server already there, which can forward your sites to the local port.

Does Nginx UI need the Docker socket?

Only to control Nginx in another container, or to replace its own container during an update from the panel. To manage the bundled Nginx and update with Docker Compose, leave it out and set NGINX_UI_IGNORE_DOCKER_SOCKET to true.

How much memory does Nginx UI need?

On our test VPS, the container used about 100 to 110 MB, Nginx included. A Managed VPS Pro 1 with 2 GB of memory, at US$19.99 per month excl. tax, is enough to start.

How do I back up Nginx UI?

Stop the container, archive compose.yaml, .env and the data folder under umask 077, then start it again and send the archive off the server. To restore, extract the archive in the same folder with tar and its numeric owners, then run docker compose up -d.

How do I update Nginx UI?

Read the release notes and take a backup, change the image tag in compose.yaml, then run docker compose pull and docker compose up -d. The image carries Nginx, which is updated at the same time.

Does a managed VPS cover Nginx UI?

A managed VPS covers the server: system, security, monitoring and backups. Our teams also proactively monitor your instance and recommend useful fixes, which you apply. Work inside the application is billed by the hour or at a fixed rate.

Contact us