Skip to content

Instantly share code, notes, and snippets.

@agurod42
Created December 17, 2025 19:36
Show Gist options
  • Select an option

  • Save agurod42/b6ceb09a6701a3e30f6a45d78bcd92c8 to your computer and use it in GitHub Desktop.

Select an option

Save agurod42/b6ceb09a6701a3e30f6a45d78bcd92c8 to your computer and use it in GitHub Desktop.
Guide for setting up Dokploy on Windows with Docker Desktop, deploying apps from templates (e.g., Metabase), and exposing them to the internet using Caddy reverse proxy and Azure Dev Tunnels.

Local Dokploy Setup Guide (Windows)

This guide covers setting up Dokploy locally on Windows and deploying applications with internet access.

Table of Contents


Prerequisites

Install the following before proceeding:

Software Download
Caddy caddyserver.com/download
Dev Tunnels winget install Microsoft.devtunnel
Docker Desktop docker.com/products/docker-desktop
NSSM nssm.cc/download

After downloading Caddy and NSSM, move caddy.exe and nssm.exe to C:\Windows\System32\.


Installing Dokploy

1. Start Docker Desktop

Launch Docker Desktop and wait for it to fully start.

2. Install Dokploy

Open PowerShell and run:

docker run -d `
  --name dokploy `
  --restart unless-stopped `
  -p 3000:3000 `
  -v /var/run/docker.sock:/var/run/docker.sock `
  -v dokploy-data:/app/data `
  dokploy/dokploy:latest

3. Access Dokploy

Open http://localhost:3000 in your browser and complete the initial setup.


Installing Applications

Metabase

Metabase is an open-source business intelligence tool for creating dashboards and visualizations.

1. Create a Project

  1. In Dokploy, click Create Project in the top right
  2. Enter a project name (e.g., "Analytics")

2. Deploy from Template

  1. Inside your project, click Create Service
  2. Select Template as the service type
  3. Browse the template library and select Metabase
  4. Click Create Service
  5. Click Deploy

3. Configure Traefik Domain

  1. Go to your Metabase service in Dokploy
  2. Navigate to Domains
  3. Add a new domain using the traefik.me format:
    product-metabase-rh2s0l-15cda3-172-30-12-90.traefik.me
    
  4. Save and wait for Traefik to pick up the configuration

Note: traefik.me is a free wildcard DNS service that resolves *.traefik.me to the IP address embedded in the subdomain.

4. Verify Internal Access

curl http://product-metabase-rh2s0l-15cda3-172-30-12-90.traefik.me

Exposing Apps to the Internet

1. Create Caddyfile

Create C:\Users\me\Caddyfile:

:3030 {
    reverse_proxy http://product-metabase-rh2s0l-15cda3-172-30-12-90.traefik.me {
        header_up Host product-metabase-rh2s0l-15cda3-172-30-12-90.traefik.me
    }
}

Why header_up Host? The upstream server checks the Host header for routing. Without this, requests arrive with Host: localhost:3030 and return 404.

2. Create the Caddy Windows Service

Run PowerShell as Administrator:

nssm install Caddy

In the GUI that opens:

Field Value
Path C:\Windows\System32\caddy.exe
Startup directory C:\Users\me
Arguments run --config C:\Users\me\Caddyfile

Click Install service, then start it:

nssm start Caddy

3. Verify Local Access

Open http://localhost:3030 — you should see Metabase.

4. Setup Azure Dev Tunnel

Login to Dev Tunnels:

devtunnel user login

Create a persistent tunnel (requires authentication to access):

devtunnel create
devtunnel port create -p 3030

Note the tunnel ID returned (e.g., abc123xyz).

Start hosting:

devtunnel host

The output will show your public URL:

Hosting port 3030 at https://<tunnel_id>-3030.usw2.devtunnels.ms/

Users must authenticate with the same Microsoft/GitHub account to access the tunnel.

5. Autostart Dev Tunnel with Task Scheduler

Run PowerShell as Administrator:

$action = New-ScheduledTaskAction -Execute "devtunnel" -Argument "host"
$trigger = New-ScheduledTaskTrigger -AtStartup
$trigger.Delay = "PT30S"
$settings = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries -RestartCount 3 -RestartInterval (New-TimeSpan -Minutes 1)
$principal = New-ScheduledTaskPrincipal -UserId "$env:USERNAME" -RunLevel Highest -LogonType S4U

Register-ScheduledTask -TaskName "DevTunnel-Dokploy-3030" -Action $action -Trigger $trigger -Settings $settings -Principal $principal

Test the task:

Start-ScheduledTask -TaskName "DevTunnel-Dokploy-3030"

Managing Services

Caddy

nssm status Caddy                              # Check status
nssm start Caddy                               # Start
nssm stop Caddy                                # Stop
nssm restart Caddy                             # Restart
caddy reload --config C:\Users\me\Caddyfile    # Reload config
caddy validate --config C:\Users\me\Caddyfile  # Validate config

Dev Tunnel

devtunnel list         # List tunnels
devtunnel host         # Start hosting
devtunnel user show    # Check login status

Troubleshooting

Caddy returns 404

  • Verify the upstream URL works directly in browser
  • Ensure header_up Host is configured correctly
  • Check that Traefik picked up the domain in Dokploy

Dev tunnel requires authentication

This is expected. Users need to authenticate with a Microsoft or GitHub account that has been granted access, or use the same account that created the tunnel.

Port already in use

netstat -ano | findstr :3030

Kill the process or choose a different port.


Quick Reference

App Local URL Traefik Domain Public URL
Metabase http://localhost:3030 product-metabase-rh2s0l-15cda3-172-30-12-90.traefik.me https://<tunnel_id>-3030.devtunnels.ms

Resources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment