How to Install Pangolin on a VPS with Docker: A Private Reverse Proxy with Login and Access Control

Some services should never be open to everyone: a home server dashboard, an internal app's admin panel, or a family document archive. Opening a router port for a service like that means anyone who finds the port can knock on its door. A VPN closes that gap, but a VPN grants access to the whole network rather than to one app, and every new device has to be configured one by one.

Pangolin takes a more precise middle path. It is a self-hosted reverse proxy with built-in identity and access control: every service gets its own web address, visitors must sign in before they reach the service, and you decide which users or roles may open which resource. Services on a private network connect to Pangolin through an outbound WireGuard tunnel, so no inbound port needs to open on the service side. This guide installs Pangolin on a VPS with its official installer, which runs a Docker stack, then connects one service through a site connector and locks it behind sign-in.

Before you start: what you need

  • A Linux server with root access and a public IP, for example an Ubuntu 20.04 or newer VPS, with Docker and Docker Compose installed.
  • A domain already pointing at the server's IP, for example example.com. Pangolin uses this base domain for the dashboard and for each resource's subdomain.
  • An email address for Let's Encrypt certificates and the admin login.
  • Firewall ports open: 80 TCP, 443 TCP, 51820 UDP, and 21820 UDP. The two UDP ports carry tunnel and client connections.
  • One private service you want to publish, for example a web app on your home network or on another VPS, to be connected later through a site connector.

Check Docker and Compose:

docker --version
docker compose version

Expected output: both commands print version numbers without errors.

Step 1: download and run the official installer

Pangolin's official installer places all of its files in the directory where you run it, so move first to the folder you want as the installation home:

mkdir -p ~/pangolin
cd ~/pangolin
curl -fsSL https://static.pangolin.net/get-installer.sh | bash

That command downloads the installer and supports both AMD64 and ARM64 architectures. Then run the installer with root privileges:

sudo ./installer

The installer asks for a few basic settings. Fill them in for your setup:

  • Edition: choose Community Edition for fully self-hosted use without a license.
  • Base Domain: enter the root domain without subdomains, for example example.com.
  • Dashboard Domain: press Enter to accept the default pangolin.example.com, or enter your own dashboard subdomain.
  • Let's Encrypt Email: enter the email address for SSL certificates and the admin login.
  • Tunneling: keep the default yes to install Gerbil, Pangolin's tunneling component. Without tunneling, Pangolin still works as a plain reverse proxy, but private services behind NAT cannot be reached.

Confirm to start the installation. Expected output: the installer pulls the Docker images pangolin, gerbil, and traefik, then starts those containers automatically. The process takes about 2–3 minutes depending on your connection speed.

Step 2: finish the initial setup and create an organization

When the installation finishes, the installer prints something like this:

Installation complete!
To complete the initial setup, please visit:
https://<your-dashboard-domain>/auth/initial-setup

Open that address in a browser. The first certificate can take a few minutes to validate, so do not be surprised if the browser shows an insecure warning on the first attempt.

You will be asked for a setup token. The installer displays it; if you did not note it down, take it from the Pangolin container logs on first start:

sudo docker compose logs pangolin

Copy the token from those logs, paste it on the initial setup page, enter the admin email and a strong password, and finish creating the account. This account holds full system access, so its password should not be reused from another service.

After signing in, create your first organization: enter an organization name and description, then click Create Organization. An organization is the container for your sites, resources, users, and roles; one installation can hold several organizations if you separate teams or family members.

The diagram above summarizes the architecture: visitors sign in through the Pangolin dashboard, Traefik forwards requests to the permitted resource, and the site connector on the private network opens an outbound WireGuard tunnel toward Pangolin, so the service behind it needs no inbound port at all.

Step 3: create a site and connect it with the site connector

A site is the bridge between Pangolin and one private network, for example your home network. In the dashboard, open Sites, create a new site, and copy the three values shown: the site ID, the site secret, and your Pangolin endpoint.

On a machine inside that private network, install the site connector with Docker Compose. Create a folder and a docker-compose.yml file:

mkdir -p ~/pangolin-site
cd ~/pangolin-site
nano docker-compose.yml

Fill it with this configuration, replacing the example values with the ones from your dashboard:

services:
  pangolin-site:
    image: fosrl/pangolin-cli
    container_name: pangolin-site
    restart: unless-stopped
    environment:
      - PANGOLIN_ENDPOINT=https://pangolin.example.com
      - SITE_ID=your-site-id
      - SITE_SECRET=your-site-secret

Then start it:

docker compose up -d
docker compose ps
docker compose logs -f pangolin-site

Expected output: the pangolin-site container shows as running, the logs show no credential errors, and the site turns online in the Pangolin dashboard. If you prefer running the connector as a binary, the official CLI installer is available via curl -fsSL https://static.pangolin.net/get-cli.sh | bash, then run pangolin up site --id your-site-id --secret your-site-secret --endpoint https://pangolin.example.com. Never share a site secret in a public repository or a screenshot; anyone holding it can register a connector in your site's name.

Step 4: create a resource and lock it behind sign-in

A resource is one application you publish. In the dashboard, open Resources, click Add Resource, and fill in:

  1. Name: a recognizable name, for example Home Dashboard.
  2. Type: choose HTTP Resource for a web application.
  3. Domain: enter a subdomain under your base domain, for example dash.example.com.
  4. Target: enter the service's private address as seen from the site network, for example host 192.168.1.50 and port 8080. This address is viewed from the site connector's perspective, not from the Pangolin VPS.
  5. Save the resource.

Now lock that resource down. By default, a private resource in Pangolin is reachable by nobody until access is granted explicitly: a connected client sees no sites or resources at all without a grant. Open the resource's Authentication tab, make sure platform SSO is on, then grant access to the users or roles that should be allowed in, and save. If you actually want a public resource, turn SSO off in the same place, but think twice before doing that for an internal service.

Test from a browser: open https://dash.example.com. Expected output: the Pangolin sign-in page appears before the service is visible. After signing in as a user with access, the app loads normally. Also try a user without access: expected output, the resource is not visible at all, rather than merely showing an error page.

Common errors and fixes

SymptomLikely causeFix
The dashboard shows a certificate warning on first openThe first certificate has not finished validatingWait a few minutes and reload; confirm the dashboard DNS record points at the VPS
The setup token cannot be foundThe installer output has scrolled awayRun sudo docker compose logs pangolin in the installation folder and copy the token from the logs
The site never comes onlineWrong ID, secret, or endpoint, or blocked UDP portsRecheck all three values from the dashboard, confirm UDP ports 51820 and 21820 are open, then check the site connector logs
The resource shows 502 or times outWrong target address, or the service is not running on the site networkCheck the target host and port from the site connector's perspective, and confirm the service is listening there
A user signs in but sees no resourceAccess has not been granted to that user or roleOpen the resource's Authentication tab and explicitly grant access to the intended user or role
A resource is public when it should be privateSSO is off on that resourceTurn platform SSO back on in the Authentication tab and save
The Pangolin containers do not start after a rebootThe installation folder was moved, or Compose was run from another folderRun commands from the original installation folder, since the Compose file and configuration live there

Updating Pangolin

The Pangolin stack is installer-managed and runs as Docker containers, so updating basically means pulling the newest images and recreating the containers from the installation folder:

cd ~/pangolin
docker compose pull
docker compose up -d
docker compose ps

Expected output: all containers return to running status, and the dashboard, organizations, and resources stay intact. Before updating, back up the installation folder and its configuration, and read the official release notes when a major change lands, since Pangolin is under active development and dashboard behavior can shift between versions.

Summary

PartValue used
InstallationOfficial installer at https://static.pangolin.net/get-installer.sh
Stack containerspangolin, gerbil, traefik
Firewall ports80 TCP, 443 TCP, 51820 UDP, 21820 UDP
Initial setuphttps://<dashboard-domain>/auth/initial-setup + token from the logs
Site connectorImage fosrl/pangolin-cli, variables PANGOLIN_ENDPOINT, SITE_ID, SITE_SECRET
Example resourcedash.example.com → 192.168.1.50:8080
AccessPlatform SSO on; access granted explicitly per user/role
Restartunless-stopped for the site connector

Final checklist

  • ☐ The Pangolin stack containers show as running in the installation folder.
  • ☐ The admin account was created through the initial setup page with the correct token.
  • ☐ The first organization is created.
  • ☐ The site connector shows online in the dashboard.
  • ☐ The first resource opens only after sign-in, and only for users with access.
  • ☐ A user without access does not see the resource at all.
  • ☐ The site secret is not stored in a public repository or screenshot.
  • ☐ The installation folder is backed up before the next update.

Which private service will you put behind Pangolin first, and who should be allowed to open it? Share it in the comments, since that user list decides the roles and grants you need to set up.

Read also: the Rnevio article "Cloudflare Tunnel: Ekspos Layanan Rumahan Tanpa Membuka Port" covers another tunneled approach without opening ports, while the paired guide in this batch is available at an Nginx Proxy Manager guide for reverse proxy and automatic SSL from the web UI.

Diskusi

Ada pertanyaan atau pengalaman yang ingin dibagikan?

0komentar

Komentar ditinjau sebelum ditampilkan. Mari berdiskusi dengan sopan dan sesuai topik.