A hands-on account of what worked, what broke, and why. Domain names, passwords, keys, and IP addresses have been generalized.
Overview
I started the day with a freshly installed Docker and a wish list: Jellyfin for movies, Navidrome for music, Kavita for books, Audiobookshelf for audiobooks, Immich for photos, Papra for scanned documents, plus Portainer and Nginx Proxy Manager to manage it all. I ended the day with everything running on a spare EliteDesk, reachable from anywhere, with a private VPN for the sensitive parts, a music downloader, and a watchdog that messages me on Signal when something breaks.
Nothing went smoothly, and the errors turned out to be the most useful part. The biggest one was port forwarding, the textbook way to expose a home server. It failed completely, because my server sits behind two routers and the outer one isn’t mine to change. I threw it out and used a Cloudflare Tunnel for public access and Tailscale for private access.
What it does
A container is one app running in its own sealed box with everything it needs. Docker Compose lets me describe all the boxes in one text file and start them with one command. Reaching them from outside the house then follows this path:
- A visitor types a name like
jellyfin.yourdomain.com. - DNS translates the name into a Cloudflare address.
- Cloudflare passes the request down a tunnel that my server opened outward, so nothing has to be forwarded on the router.
- A small program on the server (
cloudflared) hands the request to the right container by name. - Private apps (admin panels, the music downloader, the monitor) skip all of this and are reachable only over Tailscale.
Benefits:
- Public access with zero changes to the router, which matters when the router belongs to someone else
- My home IP address is never published
- One command rebuilds the whole stack, and one file documents it
- Admin panels never touch the public internet
Hardware and software
- An EliteDesk desktop, wired to the router
- Windows with Docker Desktop (WSL 2 backend)
- A domain name managed in Cloudflare
- Tailscale on the server and on my phone
- A travel router sitting behind the family’s ISP router (this causes most of the drama)
| App | What it does | Port | Reached through |
|---|---|---|---|
| Jellyfin | Movies and video | 8096 | Tunnel |
| Navidrome | Music streaming | 4533 | Tunnel |
| Kavita | Books and comics | 5000 | Tunnel |
| Audiobookshelf | Audiobooks and podcasts | 13378 | Tunnel |
| Papra | Scanned documents | 1221 | Tunnel |
| Immich | Photo backup | 2283 | Tunnel and Tailscale |
| Soulbeet + slskd | Music finder and downloader | 9765, 5030 | Tailscale only |
| Portainer | Container control panel | 9443 | Home network and Tailscale only |
| Nginx Proxy Manager | Reverse proxy (used in Plan A) | 80, 443, 81 | Home network |
| Uptime Kuma | Monitoring and alerts | 3001 | Tailscale only |
Part 1: Docker and the Compose file
How Docker Compose works
- Image: a read-only template of an app, like a frozen meal.
- Container: a running copy of that image, the meal after it’s heated up. Each one is isolated, so apps can’t fight over files or ports.
- Volume: a locker outside the container where the app keeps its data, so nothing is lost when the container is replaced. A named volume is managed by Docker; a bind mount is a folder from the PC.
- Network: a shared table where containers find each other by name, like
jellyfin:8096. - Compose file: one YAML file listing all of the above.
docker compose up -dreads it and builds everything.
Step 1: Confirm Docker works
Open Docker Desktop, accept the terms, let it install or update WSL 2, and wait for the green “Engine running” label. Then in PowerShell:
docker --version
docker compose version
Step 2: Write the compose file
One docker-compose.yml defined all seven original apps. Here is the pattern, using Jellyfin:
name: homelab
networks:
proxy:
name: proxy
volumes:
jellyfin_config:
# ...one named volume per app
services:
jellyfin:
image: jellyfin/jellyfin:latest
container_name: jellyfin
restart: unless-stopped
environment:
- TZ=${TZ}
ports:
- "8096:8096"
volumes:
- jellyfin_config:/config
- ${MOVIES_PATH}:/media/movies:ro
- ${MUSIC_PATH}:/media/music:ro
networks: [proxy]
The values in ${...} come from a separate .env file:
TZ=America/Los_Angeles
MOVIES_PATH=C:/Media/Movies
MUSIC_PATH=C:/Media/Music
BOOKS_PATH=C:/Media/Books
AUDIOBOOKS_PATH=C:/Media/Audiobooks
PAPRA_AUTH_SECRET=<a long random string>
| Line | What it does |
|---|---|
image: | Which app to download |
container_name: | The name used in commands and logs |
restart: unless-stopped | Restarts after a crash or a reboot |
"8096:8096" | host_port:container_port. The left number is the door on the PC, the right one is inside the container |
jellyfin_config:/config | A named volume for settings and databases |
${MOVIES_PATH}:/media/movies:ro | A bind mount of my movie folder. ro means read-only |
networks: [proxy] | Joins the shared network |
Use forward slashes in Windows paths here. Backslashes are special characters in these files.
Decisions I’m glad I made:
- Named volumes for app databases. Databases stored in Windows folders can be slow and can break.
- Media mounted read-only. If an app is buggy or compromised, it can’t delete the library.
- One shared network, so apps reach each other by name instead of by fragile IP address.
- Secrets and paths in
.env, so the compose file can be shared without leaking anything.
Step 3: Start everything
cd C:\homelab
docker compose up -d
docker ps
-d (detached) runs it in the background. docker ps lists running containers; every row should say Up.
Mistake #1: “I don’t have Jellyfin or any of the other apps”
I expected installers and Start-menu icons. Docker doesn’t work that way. The apps exist as images and containers, visible in Docker Desktop under Containers, and the command that “installs” all of them is docker compose up -d.
Mistake #2: The missing .env file
The first launch printed this:
WARN[0000] The "TZ" variable is not set. Defaulting to a blank string.
WARN[0000] The "MUSIC_PATH" variable is not set. Defaulting to a blank string.
invalid spec: :/audiobooks: empty section between colons
With no .env, ${AUDIOBOOKS_PATH} was blank, so the line became :/audiobooks, which is nonsense. Files that start with a dot often get renamed during download (env, or .env.txt). Fix: create the file by hand and check its exact name with dir -Force, which also lists hidden and dot-files.
Mistake #3: Portainer “timed out”
Portainer makes you create the admin account within a few minutes of first start; otherwise a stranger who reaches the page first could claim the control panel. Fix: docker restart portainer and be quick. Newer versions also print a one-time setup token in docker logs portainer.
Mistake #4: Papra refused to start
docker logs papra showed:
auth.secret (AUTH_SECRET): Invalid length: Expected >=32 but received 16
Fix: generate a long random secret in PowerShell, paste it into .env, and rebuild only that container:
-join ((48..57)+(65..90)+(97..122) | Get-Random -Count 48 | % {[char]$_})
docker compose up -d --force-recreate papra
48..57 are the character codes for digits, 65..90 for capital letters, and 97..122 for lowercase. A plain docker restart would not pick up changed settings, which is why --force-recreate is needed.
Mistake #5: Papra “Invalid application origin”
Papra compares the address in the browser with its APP_BASE_URL setting, as protection against forged requests. I had set it to the future public address while testing at http://localhost:1221. Fix: match it to whatever address I’m actually using, and recreate the container.
When an app asks for a library folder on first run, type the path inside the container, not the Windows path: Jellyfin movies are /media/movies, Kavita is /books, and Audiobookshelf is /audiobooks.
Part 2: Plan A, port forwarding (why it failed)
How port forwarding works
Every device at home shares one public address, and the router sorts the traffic (NAT). A connection started from inside is easy: the router remembers who asked. A connection started from the internet has nowhere to go unless I add a rule: “traffic arriving on port 443 goes to this device.” That rule is port forwarding. The standard recipe is to buy a domain, point it at the home IP, run a reverse proxy, and forward ports 80 and 443 to it.
I did the groundwork: a DHCP reservation for the server, a wildcard * CNAME in Cloudflare set to DNS-only, a dynamic-DNS script on a Raspberry Pi, and a wildcard Let’s Encrypt certificate in Nginx Proxy Manager using the DNS challenge with a Cloudflare API token scoped to one zone. (The HTTP challenge needs open ports, which I didn’t have, and wildcards can only use the DNS challenge anyway.)
Mistake #6: Planning the network before looking at it
The router admin page was a GL.iNet panel. I was about to forward 80 and 443 to the server when it came out that this was a travel router plugged into the family’s ISP router, not the internet.
Internet
| (one public IP, owned by the ISP router)
+--v-------------------+
| Family router | <- not mine, "please don't touch"
| (ISP-provided) |
+--+-------------------+
|
+--v-------------------+
| Travel router | <- mine; rules here forward traffic that never arrives
| (GL.iNet) |
+--+-------------------+
|
+--v-------------------+
| EliteDesk + Docker |
+----------------------+
This is double NAT. A rule on the inner router only works if the outer router first sends the traffic to it, so the outer router needs matching rules too. The obstacles:
- Double NAT. Forwarding on my router alone does nothing.
- Not my router. My parents didn’t want their network touched, and that’s fair.
- Password wall. The admin password had been changed, and resetting the router would wipe the whole house’s Wi-Fi.
- Provider quirks. Some ISP gateways push port forwarding into an app for the account holder and may block inbound port 80.
- CGNAT risk. If the router’s WAN address starts with
100.or a private range, another NAT sits upstream and forwarding can’t work at all.
Lesson: check how the network is actually connected before designing around it. One look at the router’s WAN page would have shown the double NAT within a minute.
| Option | Verdict |
|---|---|
| Ask my parents to forward port 443 to my travel router | Works, but needs their permission and their router |
| Cloudflare Tunnel | Works behind any router, nothing to forward |
| Tailscale | Works behind any router, but only for devices I install it on |
Decision: Cloudflare Tunnel for public access and Tailscale for private access.
Part 3: Plan B, the Cloudflare Tunnel
How a tunnel works
Instead of asking the front door to let visitors in, the server digs a passage out to Cloudflare. Visitors knock on Cloudflare’s door, and Cloudflare walks them through the passage. Nobody ever knocks on the house.
Technically, cloudflared runs next to the apps and opens outbound, encrypted connections to Cloudflare. That avoids every problem from Part 2:
- Outbound connections work behind double NAT and CGNAT, so there is nothing to forward.
- No router changes, so my parents’ network stays untouched.
- My home IP is never published, and the dynamic-DNS script isn’t needed.
- Cloudflare handles the HTTPS certificate.
Step 1: Create the tunnel
In the Cloudflare dashboard: Networking → Tunnels → Create Tunnel → Cloudflared, name it homelab, choose Docker, and copy the token from the command it shows. The token is one very long string that starts with eyJ.
Mistake #7: Tunnel ID instead of tunnel token
The container kept printing Provided Tunnel token is not valid. I had copied the tunnel ID, a short code with dashes, instead of the token. The ID only names the tunnel; the token is the password the container uses to log in.
Lesson: when a credential is rejected, check that it’s the right kind of credential before assuming it’s mistyped.
Step 2: Add it to the stack
Add CLOUDFLARE_TUNNEL_TOKEN=eyJ... to .env, then add this service to docker-compose.yml:
cloudflared:
image: cloudflare/cloudflared:latest
container_name: cloudflared
restart: unless-stopped
command: tunnel --no-autoupdate run
environment:
- TUNNEL_TOKEN=${CLOUDFLARE_TUNNEL_TOKEN}
networks: [proxy]
docker compose up -d
docker logs cloudflared --tail 20
The logs should say the tunnel connection registered, and the dashboard flips to Healthy.
Step 3: Tell Cloudflare where each name goes
Inside the tunnel’s page: Routes → Add route → Published application.
| Subdomain | Service URL |
|---|---|
| jellyfin | http://jellyfin:8096 |
| books | http://kavita:5000 |
| audiobooks | http://audiobookshelf:80 |
| music | http://navidrome:4533 |
| papers | http://papra:1221 |
Note audiobookshelf:80, not 13378. The tunnel talks to the container directly, so it uses the port inside the container. 13378 is only the door on the PC.
Mistake #8: The wrong Routes page
The dashboard’s left menu has an account-wide Routes page for private networks (CIDR ranges). That isn’t where published applications live. The routes I needed are inside the tunnel’s own page.
Test: turn off Wi-Fi on a phone, use cellular, and open https://papers.yourdomain.com. Login page, padlock, done.
Step 4: Clean up
I deleted two DNS records: the home A record, which was publishing my parents’ public IP address for anyone to look up, and the * wildcard CNAME. I also switched off the dynamic-DNS cron job on the Raspberry Pi (crontab -e) so it couldn’t recreate the IP record.
Mistake #9: Underestimating the free-plan limits
I first described tunneling video as a “gray area.” After reading Cloudflare’s own documentation, that was too soft. On the free plans, serving video and other large files through Cloudflare’s network requires a specific paid service, and tunneling Jellyfin can break those terms. The risk is a throttled or suspended account, and my domain lives there. Free plans also cap uploads at 100 MB per request, which breaks large video uploads to Immich.
Lesson: read the fine print of free tiers when the account holds something you care about. My plan: the public tunnel for light apps, and Tailscale for heavy streaming and big backups.
Part 4: Tailscale, the private network
How Tailscale works
Tailscale builds a private network for my own devices. Each one gets an address starting with 100., and they can reach each other as if they were on one home network, from anywhere. Underneath it’s an encrypted WireGuard mesh. Devices connect outward to Tailscale’s coordination service, so no port forwarding is needed and it works behind my double NAT.
Anything not on the tunnel stays reachable only through it: Portainer, Nginx Proxy Manager, Soulbeet, slskd, and Uptime Kuma.
Step 1: Install and test
Install Tailscale on the server and the phone, sign in with the same account, and each device appears in the admin console with its own 100.x.x.x address. From the phone with Wi-Fi off, apps load at addresses like http://100.x.x.x:8096. Plain http:// is fine here, because Tailscale already encrypts everything.
Mistake #10: Two separate tailnets
The admin page showed one machine, the phone. The server had signed in to a different account, probably because the browser auto-picked another saved account. Two accounts means two separate networks that can’t see each other.
The reliable fix is an auth key (Settings → Keys → Generate auth key, 1 day, not reusable):
tailscale logout
tailscale up --auth-key=tskey-auth-XXXXXXXX
An auth key is a one-day guest pass. The server presents it and joins the right network directly, with no browser and no account picker.
Lesson: when two devices can’t see each other, compare the account on each one before touching anything else.
Mistake #11: “tailscale is not recognized”
PowerShell didn’t know where the program lived in that session. The fix is to call it by its full path with the & call operator:
Test-Path "C:\Program Files\Tailscale\tailscale.exe"
& "C:\Program Files\Tailscale\tailscale.exe" up --auth-key=tskey-auth-XXXXXXXX
To keep the server on the network: enable Run unattended so it connects after a reboot before anyone signs in, and disable key expiry for the server in the admin console.
Part 5: Immich (photos)
Immich is four containers working as a team (server, machine learning, a Redis-compatible cache, and a Postgres database), and it changes often. So it got its own folder and its own compose file, using the official files from Immich’s GitHub releases instead of a recipe that goes stale.
cd C:\immich
ren example.env .env
In .env, set UPLOAD_LOCATION=C:/immich/library, DB_DATA_LOCATION=pgdata, the time zone, and a random DB_PASSWORD (letters and numbers only). pgdata puts the database in a Docker named volume, because Postgres on a Windows-mounted folder can run into permission and speed problems.
Mistake #12: A YAML error
go-yaml load error in scanner (while scanning a simple key) at L79.C3-L80.C1:
could not find expected ':'
YAML is strict: every key needs a colon, and indentation carries meaning. The new pgdata line was indented differently from the lines around it. The end of the file needed to look exactly like this, with spaces and no tabs:
volumes:
model-cache:
pgdata:
Lesson: always validate before starting. This prints nothing if the file is valid and an error with a line number if not:
docker compose config --quiet
Mistake #13: Misreading the naming request
I wanted immich.yourdomain.com handled like the other apps, through the tunnel. Immich lives in its own compose project and network, so the tunnel can’t find it by container name. The route is http://host.docker.internal:2283, a special name from Docker Desktop that means “the PC itself,” where port 2283 is published. Because of the 100 MB upload cap, big video backups go over the Tailscale address instead.
Part 6: Soulbeet and slskd (music downloader)
- slskd is a web-based Soulseek client running in a container.
- beets fixes tags and files songs into tidy folders.
- Soulbeet is the front desk: pick an album from a catalog, it asks slskd to find the files, downloads them, has beets tidy them, and drops them in the music folder where Navidrome picks them up.
Only download music you have the right to have. Both apps stay off the tunnel and are reachable only over Tailscale.
Finding the right folders
docker ps and Portainer’s container details showed Navidrome’s music mount, and the com.docker.compose.project.working_dir label pointed at the compose folder. Then I confirmed the music variable:
Get-Content C:\HOMELAB\.env | Where-Object { $_ -match '^MUSIC_PATH=' }
Before editing, a health check and a backup:
docker compose -f C:\HOMELAB\docker-compose.yml config --quiet
Copy-Item C:\HOMELAB\docker-compose.yml C:\HOMELAB\docker-compose.backup.yml
Mistake #14: Typing a path as if it were a command
PowerShell answered C:\Media\Downloads : The term ... is not recognized. A path by itself isn’t a command. Nothing broke.
Mistake #15: An empty secret key
The first attempt at generating Soulbeet’s secret key called Python, which isn’t installed. PowerShell printed “Python was not found” but kept going and wrote an empty SECRET_KEY= line into .env.
Lesson: a failed command can still leave a half-finished change behind. Check what a command actually wrote, instead of trusting the “success” message that follows it.
Mistake #16: A method that doesn’t exist in Windows PowerShell
A .NET shortcut failed because Windows PowerShell 5.1 runs on an older .NET. The version that works there asks the operating system for 32 cryptographically random bytes:
$rng = [System.Security.Cryptography.RandomNumberGenerator]::Create()
$bytes = New-Object byte[] 32
$rng.GetBytes($bytes)
$key = [Convert]::ToBase64String($bytes)
$rng.Dispose()
Adding both services
slskd:
image: slskd/slskd:latest
container_name: slskd
restart: unless-stopped
ports:
- "5030:5030"
environment:
- SLSKD_REMOTE_CONFIGURATION=true
volumes:
- ./slskd/data:/app
- C:/Media/Downloads:/app/downloads
networks: [proxy]
soulbeet:
image: docker.io/docccccc/soulbeet:latest
container_name: soulbeet
restart: unless-stopped
ports:
- "9765:9765"
environment:
- DATABASE_URL=sqlite:/data/soulbeet.db
- SLSKD_URL=http://slskd:5030
- SLSKD_API_KEY=${SLSKD_API_KEY}
- SLSKD_DOWNLOAD_PATH=/downloads
- SECRET_KEY=${SECRET_KEY}
- NAVIDROME_URL=http://navidrome:4533
volumes:
- ./soulbeet/data:/data
- C:/Media/Downloads:/downloads
- ${MUSIC_PATH}:/music
depends_on:
- navidrome
- slskd
networks: [proxy]
Navidrome keeps /music read-only, while Soulbeet gets write access to the same folder so beets can file new music.
Mistake #17: Placeholder text left in the config
slskd’s API key is configured in its own YAML (System → Options). The template I pasted still held placeholder words like CHOOSE-A-USERNAME. Saved as-is, slskd would have logged in to Soulseek with that literal name. I caught it before saving.
Lesson: reread any pasted template for leftover placeholders before saving it.
Mistake #18: curl.exe wasn’t available
The built-in PowerShell version works everywhere, and reading the key from .env means it never gets typed or pasted:
$k = ((Get-Content C:\HOMELAB\.env | Where-Object { $_ -match '^SLSKD_API_KEY=' }) -replace '^SLSKD_API_KEY=','').Trim()
$r = Invoke-RestMethod -Headers @{"X-API-Key"=$k} http://100.x.x.x:5030/api/v0/application
$r.server.state
The answer Connected, LoggedIn ruled out slskd, so the problem had to be on the Soulbeet side.
Mistake #19: Looking inside a container that has no tools
docker exec soulbeet env failed with executable file not found; the image is stripped down. Ask Docker from the outside instead:
docker inspect soulbeet --format '{{range .Config.Env}}{{println .}}{{end}}' | findstr SLSKD
It showed the slskd address and key, so the container had them. That key was printed on screen and later pasted into a chat, so I’m rotating it.
Mistake #20: The Config page that only mentioned Navidrome
I was logged in as a normal user. This Soulbeet version splits admin and user accounts, and the slskd and folder settings are admin-only. Fix: log in as the built-in admin, change that password immediately, and fill in the slskd URL, API key, and download path.
Lesson: when a settings page looks incomplete, check which account you’re on before assuming the feature is missing.
Mistakes #21–23: Wrong tests and wrong docs
- Soulbeet’s search box only queries a music catalog (MusicBrainz, Last.fm). It asks slskd for files only after I pick an album and click Download. My “is it connected?” test was wrong; it worked all along.
- “No folder roots are approved yet”: normal users can only add folders inside a root an admin has approved. For a one-person server, the admin account is simplest.
- I went looking for a menu that doesn’t exist in this version because I’d mixed up instructions for different forks. Trust the screen and the version in front of you.
Part 7: Uptime Kuma (monitoring)
Uptime Kuma checks every service once a minute and alerts me when one stops answering. It got its own folder, so the big compose file stayed untouched:
services:
uptime-kuma:
image: louislam/uptime-kuma:2
container_name: uptime-kuma
restart: unless-stopped
ports:
- "3001:3001"
volumes:
- kuma_data:/app/data
volumes:
kuma_data:
I chose SQLite (one file, no setup). Monitors: HTTP(s) every 60 seconds for each public address, which tests the whole path (DNS, Cloudflare, the tunnel, and the container), plus TCP port monitors against host.docker.internal for the private apps. Alerts go to Signal.
One limit: Uptime Kuma lives on the same PC. If the whole machine or the internet goes down, the watchdog goes down with it. A free outside monitor covers that gap.
Error cheat sheet
| Symptom | Layer | What it means | Fix |
|---|---|---|---|
variable is not set, :/audiobooks | Configuration | .env wasn’t read | Create .env, check the exact name with dir -Force |
| Container exits with a config error | Application | A setting is invalid | docker logs NAME, fix it, --force-recreate |
| ”Invalid application origin” | Application | Browser address doesn’t match the app’s setting | Match APP_BASE_URL to the address used |
| Port forward does nothing | Network | Double NAT or CGNAT upstream | Use a tunnel or Tailscale |
| ”Tunnel token is not valid” | Authentication | Tunnel ID pasted instead of the token | Copy the eyJ... token |
| Cloudflare 502 on a route | Application | Wrong container name or port in the route | Fix the Service URL |
| Tailscale shows one device | Account | Devices signed in to different accounts | Use an auth key |
tailscale not recognized | Shell | Program not on that session’s path | Run it by full path with & |
| YAML “could not find expected ’:‘“ | Syntax | Bad indentation or a missing colon | Fix the line, run config --quiet |
| slskd returns 401 | Authentication | API keys don’t match | Use the same key in slskd and the client |
exec: "env": not found | Tooling | Minimal image has no shell tools | Use docker inspect --format |
| Settings page missing options | Authorization | Logged in as a normal user | Log in as admin |
Hardening and reliability checklist
These are recommendations, not all finished work:
- Never expose the admin panels (Portainer, Nginx Proxy Manager, slskd, Soulbeet, Uptime Kuma) to the internet. Reach them over Tailscale.
- Change every default login and rotate any key that appeared in a chat or screenshot.
- Keep Jellyfin and Immich traffic light on the free tunnel; use Tailscale for heavy streaming and big backups.
- Survive reboots and power cuts: Docker Desktop starts at sign-in, BIOS “After Power Loss” set to Power On, Tailscale “Run unattended” with key expiry disabled.
- Back it up. A single drive is a single point of failure. Copy the media, Immich library, compose folders, and Docker volumes to an external drive on a schedule (3-2-1 rule).
- Update on purpose, per folder:
docker compose pull, thendocker compose up -d. Read Immich’s release notes first. - Remove what’s unused, like the Nginx Proxy Manager container and its Cloudflare token.
Takeaways
- Check the network before designing around it. One look at the router’s WAN page would have revealed the double NAT and saved an hour.
- Outbound beats inbound. Tunnels and VPN meshes connect outward, so they work where port forwarding can’t.
- Validate before launching.
docker compose config --quietand a glance atdocker logsturn mysteries into one-line errors. - Silent failures are the worst kind. The empty
SECRET_KEYlooked fine until it wasn’t. - Read the error, not just the message. A 401 versus a 502 versus “not valid” each pointed at a different layer: credentials, routing, or the wrong kind of credential.
- Know which account you’re on. Two Tailscale accounts and an admin-versus-user Soulbeet account produced the same symptom: settings that seemed to be missing.
- Don’t paste secrets. Keys went into a chat and a screenshot. Rotate them.
- Read the fine print. Free-tier terms matter when the domain you care about lives there.