How to Self-Host LinuxServer Wektop with Docker: A Linux Desktop in Your Browser, Exposed With Zero Open Ports
A Linux desktop in your browser on CapRover, published with zero open ports.
Webtop (linuxserver/webtop) serves a desktop environment from a Docker container into your browser — any flavor you care to run, from MATE to KDE to XFCE. This deploy stands it up on CapRover, gives it a persistent /config, and publishes it through a Cloudflare Tunnel, so no inbound port opens and your server IP never lands in a DNS record. The desktop flavor is one field; everything else in the setup is identical.
The shape:- One-click deploy the official webtop template on CapRover; the version tag is the desktop (MATE, XFCE, KDE, GNOME, i3, OpenBox) - WebSocket Support ON — the desktop will not render without it - A persistent volume at /config so the desktop survives restarts - Verify the Let's Encrypt cert, then add a tunnel hostname that points at the internal app URL
Pick the desktop
The version tag is the desktop. LinuxServer publishes Alpine, Ubuntu, Fedora, Debian and Arch bases in MATE, XFCE, KDE, i3 and OpenBox; the tag you pick is the only thing that changes. I ran ubuntu-mate. Nothing below cares which one you chose.
Every base ships the same desktop set, with two Wayland-only tags to watch for:
- Alpine: i3, KDE (Wayland only), MATE, XFCE
- Arch: i3, KDE (Wayland only), MATE, XFCE
- Debian: i3, KDE, MATE, XFCE
- Fedora: i3, KDE, MATE, XFCE
- Ubuntu: i3, KDE, LXQt, MATE, XFCE, plus the
devtag
alpine-kde and arch-kde are Wayland-only, so an X11-only application inside them will not run; every other tag is X11 with Wayland support alongside. Images publish for both x86-64 and arm64, which keeps a Raspberry Pi on the table as a host.
Deploy on CapRover
CapRover's one-click catalog ships webtop, so there is nothing to hand-build. Dashboard → One-Click Apps/Databases → Webtop, then set the fields. Labels shift a little between CapRover releases; the app configuration docs are the reference if a menu moved.
- App name:
web— becomes<app>.<root-domain> - Version tag: your desktop, e.g.
ubuntu-mate - Timezone: your tz, e.g.
Africa/Nairobi - User ID / Group ID:
1000 - User / Password: your login
Two settings CapRover does not ask for when you create it — set them on the app after deploy:
- Websocket Support: ON. webtop's streaming layer relays pixels and input over WebSockets; leave the toggle off and the page loads a desktop that never responds to the mouse.
- A persistent volume at
/config. This holds the profile and anything you install. Skip it and every restart rebuilds the desktop from scratch.
Wektop also needs shared memory sized at 1 GB (shm_size: "1gb") — under-provision it and the desktop crashes on GUI calls that depend on /dev/shm. CapRover's template handles this; a hand-rolled docker-compose has to set it explicitly.
Set the login password
webtop reads its login from CUSTOM_USER and PASSWORD. In an API-driven one-click deploy the password field can come through verbatim as the placeholder $$cap_gen_random_hex(16) — a pseudo-variable the template intends CapRover to resolve into a random value, which it does not always do. Logging in with that literal string fails. Set the PASSWORD you actually want in the app's Environment Variables and redeploy, then log in with CUSTOM_USER + that value. This is the step that bites; I chased a login that refused everything until I looked at what the running container had in PASSWORD.
Ports and the certificate gotcha
Behind a proxy, webtop listens on container HTTP port 3000 — that is what CapRover uses and what this guide targets. Directly on the internet is a different story: the session ships a self-signed certificate on port 3001, so a browser warns you on first visit and a strict reverse proxy that validates certificates rejects the origin. Two clean paths: keep CapRover's proxy path (which is what the deploy above does), or if you hand-roll a proxy, point it at the plain HTTP port or disable certificate validation on the origin.
Security
Wektop is open by default. CUSTOM_USER and PASSWORD default to abc, and if you never set them there is no HTTP basic auth at all. The web interface also ships a terminal with passwordless sudo, so anyone who reaches the GUI is root inside that container — the LinuxServer docs call the container privileged for exactly that reason and refuse to own internet exposure without a proxy in front.
The tunnel solves exposure, not authorisation. Set a real password, and for anything public put a Cloudflare Access policy in front so a login you control comes before any traffic reaches the app. On a trusted local network, HTTP basic auth is fine; on the open internet it is a starting gate, not a door.
What it is not for
Wektop is a browser desktop, not a hypervisor. Kernel development, anything that needs a full systemd, nested virtualization, low-level networking labs (VLANs, DHCP servers, raw packet capture) and malware analysis belong on a real VM or a dedicated machine. The container isolates a session, not hardware, and the render pipeline is software-based, so GPU-class graphics work is poorly served. For that narrow band, keep the VM.
What you get besides the desktop
The Selkies streaming client carries clipboard sync, drag-and-drop file transfer, audio and microphone, up to four gamepads, multi-monitor layout and session sharing. Set LC_ALL to launch the session in another language, or use the kiosk and lockdown variables for a locked-down display. GPU acceleration is optional: a GPU mounted as /dev/dri is auto-detected and wired for zero-copy rendering, Intel and AMD needing one flag and nothing else, while Nvidia requires a host driver of 580 or newer plus seccomp:unconfined and is not available on the Alpine tags.
FAQ
Is webtop free? Yes. LinuxServer is an open-source project and the image is GPL-3.0 licensed.
Does it need a GPU? No. The CPU pipeline is smooth on modest hardware; a GPU is only worth mounting for heavier workloads.
Do my changes survive a restart? Yes, on the /config volume — the desktop profile and anything you install persist.
Why does my reverse proxy keep failing? Almost always the self-signed certificate on port 3001. Point the proxy at plain HTTP port 3000, or disable certificate validation for that origin.
Is it safe on the open internet? Not by default. It has no authentication until you set CUSTOM_USER/PASSWORD, and its terminal is passwordless sudo. Put a real proxy and an access policy in front.
Expose it through the tunnel
Install cloudflared on the server and run the connector as a systemd service so it survives reboots, with the token in a file only root can read:
sudo cloudflared --no-autoupdate --protocol http2 \
tunnel run --token-file /etc/cloudflared/token
The token is the whole credential — anyone holding it can attach another connector to your tunnel, so it stays out of version control and out of your Syncthing folder. The tunnel model is covered end-to-end in Setting Up Cloudflare Tunnel with Docker; those steps work here with the connector on the host instead of in Compose.
In the Cloudflare Zero Trust dashboard, open the tunnel → Add a public hostname:
- Service type:
HTTPS - URL: the internal CapRover URL you just verified, e.g.
web.your-domain.com - HTTP Settings → Origin Server Name: the same internal hostname
That origin-server-name field is where it breaks. Without it cloudflared forwards the public hostname's Host header down the connection, CapRover's nginx has no route for that unknown host, and you get a 404 while the app is running. Setting the origin server name tells nginx which app to route to. Cloudflare then creates the proxied CNAME and issues the edge certificate, so nothing in DNS ever points at your server — the default-deny firewall you set up stays exactly as it was.
After it is running
Open the public URL, log in, and the desktop is there. Any other internal-only CapRover app gets the same treatment by adding another hostname to the same tunnel; how to self-host SearXNG is the reference for the CapRover-side pattern, and installing CapRover covers a box you do not have yet. The desktop shares the host's outbound address with everything else, so keep applying the same default-deny thinking — one app exposed cleanly is still one network path.