Part 2 – Getting started with Pangolin
In Part 1, I described how my homelab ended up with Pangolin, Traefik, CrowdSec and k3s.
Looking at that setup today, it's quite easy to get the impression that you need all of those components to get started. You don't.
My own journey started with Docker Compose. If I were setting everything up again, I'd start there too, with one application and a fairly modest goal: being able to access it from outside my home network without forwarding a port on my router for it.
Everything else can come later.
What Pangolin actually does
The thing that appealed to me about Pangolin was that it changed where I had to expose my services.
Instead of directing internet traffic straight towards my home network, I could put a gateway on a public VPS. A connector at home establishes a tunnel to that gateway, and I decide which applications can be reached through it.
There are four names you'll come across:
| Component | Where it runs | What it does |
|---|---|---|
| Pangolin | VPS | Manages resources, identities and access policies |
| Traefik | VPS | Handles web traffic, reverse proxying and TLS |
| Gerbil | VPS | Provides the WireGuard tunnel endpoint |
| Newt | Home network | Connects the private network to Pangolin |
A Site is the object you create in Pangolin to represent a network or location. Newt is the software running at that location which connects the Site to your gateway.
For a first web application, the architecture can be as simple as this:
Browser
|
HTTPS
|
+-------------------+
| Public VPS |
| Pangolin |
| Traefik + Gerbil |
+-------------------+
^
| WireGuard tunnel
| initiated from home
|
+-------------------+
| Home network |
| Newt -> Web app |
+-------------------+
The arrow shows Newt initiating the tunnel from home. Requests and responses travel over the established connection.
For the application in this example, no inbound port forwarding is required at home. The VPS, however, is exposed to the internet and has become part of the security boundary.
Start with a small VPS
I'd suggest a clean Linux VPS, a domain whose DNS records you can manage, and a little time to get familiar with the system.
You don't need a machine the size of the one I described in Part 1. Mine also runs a number of other workloads. For a small gateway, size the server according to the official VPS recommendations and your expected traffic.
For this article, let's use example.com rather than a real domain.
| DNS record | Destination |
|---|---|
pangolin.example.com |
Public IP of the VPS |
demo.example.com |
Public IP of the VPS |
A wildcard DNS record can save some work later, but it doesn't publish applications on its own. And don't rely on an obscure hostname to keep a service hidden. Publicly trusted certificates issued for individual hostnames can reveal those names in Certificate Transparency logs, searchable through sites such as crt.sh. A wildcard certificate need not list each covered hostname, but neither a wildcard nor an obscure DNS name is access control.
The standard self-hosted configuration uses TCP 80 and 443 for web traffic and certificate validation, UDP 51820 for site tunnels, and UDP 21820 when clients need the default relay endpoint. Check the networking documentation for your chosen configuration.
These ports belong on the VPS, not on your home router. I prefer SSH key authentication with password login disabled and SSH access limited by the provider firewall where practical.
One Docker trap worth knowing about: a published container port can bypass the rules you configured in ufw. Docker explains why in its firewall documentation. Check the provider firewall too, and check from outside the VPS rather than relying on ufw status alone. From another machine, scan only an address you own or are authorised to test:
# Replace the documentation address with your own VPS IPv4 address
nmap -Pn -p- 203.0.113.10
This checks TCP ports. Check IPv6 separately if you use it; for the WireGuard UDP ports, also verify the firewall rules and an actual Newt connection. A silent UDP port is not proof that it is closed.
Installing Pangolin
Pangolin has an official installer, and for a new installation I'd use the Quick Install Guide rather than copy a large Compose file from somebody's blog — including mine.
The installer prepares the container stack and asks for the information needed to configure your server. For our example, choose Community Edition, use example.com as the base domain and pangolin.example.com for the dashboard. Enable tunnelling, and provide an email address for certificate registration. Read the installer and its requirements before running it with elevated privileges.
Once the containers are running, a useful first check from the installation directory is:
docker compose ps
docker compose logs --tail=50 pangolin
docker compose logs --tail=50 traefik
Use the initial setup token as described in the official guide, create your administrator account and your first organisation. Keep the token and site credentials out of screenshots and shared logs. Use a unique administrator password and enable two-factor authentication (TOTP). Check that the dashboard has a valid HTTPS certificate before entering credentials. If certificate issuance fails, the Traefik log is the first place I would look.
At this point, resist the temptation to add every service you run. I know that's the interesting part, but one working resource is enough to start with.
Connecting your home network
Create a Pangolin Site in the dashboard and call it something like home-lab.
Pangolin provides the credentials when you create the Site. Install the connector on a machine that can reach the application. I use standalone Newt, which is still supported; the current documentation recommends the Pangolin CLI for new sites. The Newt installation guide covers both the recommendation and the standalone installation options.
Keep the generated site credentials private. They are what allow the connector to establish its connection to your gateway.
Before adding an application, check that the site is online and that the application is reachable from the connector's network. Those are two separate things: a healthy tunnel doesn't guarantee a healthy backend.
Publishing the first application
I'd start with a disposable web application or a simple test page, not an administration interface or a password manager.
Here is an illustrative resource configuration:
| Setting | Example |
|---|---|
| Resource type | Public HTTP/HTTPS |
| Public hostname | demo.example.com |
| Site | home-lab |
| Backend | http://192.168.10.20:8080 |
| Access | Pangolin authentication required; grant a dedicated test role |
The backend address is just an example. Use an address Newt can actually reach. In a normal Docker bridge network, localhost inside a container points back to that container, not the host or its neighbours.
I've hit the same class of problem elsewhere: my Forgejo runner talked to Forgejo via the public URL, although both were on the same Docker network. Switching to http://forgejo:3000/ brought it back online. Before troubleshooting the gateway, establish which network the connecting process is actually using.
Once the resource is configured, switch off Wi-Fi on your phone and open its HTTPS URL using mobile data. With the access policy enabled, Pangolin should require authentication before allowing the request through to the application.
I would keep any existing application authentication in place. There is no reason to remove a working security layer merely because we've added another one.
Public doesn't necessarily mean anonymous
A public HTTPS resource has a publicly reachable endpoint on the gateway. You can still require a user to authenticate and grant access only to selected users or roles. That is useful when you want browser access without installing a client on every device.
A private resource, by contrast, is reached through the Pangolin client, with access granted to the relevant users or roles. For something like a private administration service, I'd start by asking whether it needs a public endpoint at all.
Be particularly careful with raw public TCP and UDP resources. They forward traffic without the identity-aware authentication applied to protected web resources. A tunnel alone doesn't turn an arbitrary protocol into an authenticated web application.
The resource documentation explains the different access models and supported site types.
Test what happens when access is denied
It's tempting to declare the installation finished as soon as the first application loads. I'd spend a few more minutes checking the other side of the access policy:
- On your phone, using mobile data and a fresh private browser session, open the URL without signing in. Expect a login prompt rather than the test page.
- Sign in as an ordinary test user with the assigned role. The test page should load.
- Sign in as another test user without that role or any direct grant. The test page should remain inaccessible.
- With the first user still signed in, remove their access from a separate administrator session and reload the page, bypassing the cache. I haven't tested how quickly existing sessions lose access, so check it rather than assume it. Explicit session revocation is available in Enterprise Edition and Cloud.
- From an external network, try reaching your own home WAN address on the backend's port rather than using the Pangolin hostname. It should not return the test page. Check the router's port-forwarding rules and, if the backend has a globally routed IPv6 address, test that path too. A successful visit through Pangolin alone tells you nothing about direct exposure.
The goal isn't just to see a successful login. It's to establish that access works for the people who should have it and doesn't work for those who shouldn't.
If something fails, don't immediately disable authentication. Check DNS, TLS, the site connection, the backend and the access policy separately.
I learned that lesson again after a VPS reboot during my Docker Compose days. The applications, Pangolin and Gerbil were healthy, but Traefik hadn't restarted. The culprit turned out to be my own log rotation setup: the postrotate hook in /etc/logrotate.d/traefik called docker kill --signal=USR1 traefik. In my setup, Docker had recorded Traefik as manually stopped, so restart: unless-stopped left it down after the reboot. Nothing was wrong with the tunnel.
The immediate recovery was simple: docker start traefik. For the permanent fix, I settled on removing the postrotate hook that sent the signal, while keeping both copytruncate and restart: unless-stopped. There was no need to change the restart policy or restart the whole stack.
That's why docker compose ps is still one of my first checks.
What I wouldn't add just yet
My production setup now runs on k3s, with CrowdSec and additional HTTP protection. Those components serve a purpose in my environment, but they aren't prerequisites for this first step.
I'd establish a working baseline first. Keep the gateway updated and protect the administrator account.
For the standard Docker Compose installation, Pangolin's persistent data is under config/, next to docker-compose.yml. That includes the main configuration, SQLite data, the Gerbil key and Traefik configuration and certificate storage. See the Compose layout and update guide.
For a small SQLite-backed installation, I'd schedule a short maintenance window, stop the stack and copy the whole config/ directory, the Compose file and any additional environment or mounted configuration files. Start the stack again afterwards. Keep the backup encrypted and off the VPS, and try restoring it in a separate environment. If you've chosen different mounts or an external database, include those in your backup plan as well. A database copied while writes are in progress isn't something I'd rely on without a consistent backup method.
There is also a reason I'm working on simplifying my own Helm chart: the more I use this setup, the more I appreciate the difference between options that are useful and options that are essential. I haven't finished that work yet, so for now the official installation path remains my recommendation for getting started.
A final thought
One of the pleasant things about this approach is that my applications don't have to move. I can leave them on the machines where they already run, while changing how I reach them from outside.
But Pangolin hasn't removed the need to secure my applications, my connector or my VPS. It has given me a better place to make decisions about access.
To me, that's a good first step towards Zero Trust. Not because I've installed something with the right label, but because I can be more deliberate about who gets to reach what.
You don't have to expose your entire homelab to use one application from outside. Most of mine can simply stay private. I'd start with one application, test it and add the next one when I actually need it.
Further reading
- Pangolin – How it works
- Pangolin – Quick Install Guide
- Pangolin – DNS & Networking
- Pangolin – Install Newt
- Pangolin – Understanding Resources
- Pangolin on GitHub
- Docker – Packet filtering and firewalls
- Let's Encrypt – Certificate Transparency
Next in this series: Integrating CrowdSec – because controlling who can reach an application is only one part of dealing with traffic from the internet.
AI disclosure: I used AI to help draft and edit this article and to check it against the documentation. The experiences described are from my own homelab. I haven't re-run the example installation for this article, and the session-revocation behaviour is untested.
Top comments (0)