---
title: "In Docker ausführen (Community-Muster) | Wantastic Docs"
description: "Führe wantasticd in einem Docker-Container aus, der aus dem offiziellen Release gebaut wird: ein kleines Image bauen, einmal mit genkey zuordnen und dann im Hintergrund ausführen. Kein offizielles Image."
url: "https://wantastic.app/de/docs/install-docker"
category: "Install wantasticd"
reading_time: "5 Min."
---

# In Docker ausführen (Community-Muster)

Führe wantasticd in einem Docker-Container aus, der aus dem offiziellen Release gebaut wird: ein kleines Image bauen, einmal mit genkey zuordnen und dann im Hintergrund ausführen. Kein offizielles Image.

> **Outcome:** Ein selbst gebauter Container führt wantasticd aus, behält seine Zuordnung in einem benannten Volume, startet automatisch neu und wird in der Konsole als Online angezeigt.

## Before you start

- Docker Engine 20.10+ (oder Podman) auf einem Linux-Host mit TUN-Treiber.
- Berechtigung, Container mit --cap-add NET_ADMIN und --device /dev/net/tun auszuführen.
- Ein Smartphone oder ein Browser, um dich in der Wantastic-Konsole anzumelden.

## Schnellinstallation (5 Minuten)

Es gibt kein offizielles Image. Du baust ein kleines aus dem offiziellen Release, ordnest es einmal zu und lässt es dann im Hintergrund laufen. Es wird kein Token benötigt.

1. Speichere das Dockerfile unten in einem leeren Ordner. Setze WANTASTIC_ARCH auf die CPU deines Hosts (amd64, arm64 oder arm).
2. Baue das Image und führe genkey einmal mit dem Zuordnungsbefehl aus. Es gibt eine Claim URL und einen QR-Code aus.
3. Scanne den QR-Code oder öffne die Claim URL, melde dich an und klicke auf Claim Device.
4. Sobald "Device claimed" ausgegeben wird, drücke Strg+C. Die Zuordnung wird im Volume wantastic gespeichert.
5. Starte den Container mit dem run-Befehl im Hintergrund.

Dockerfile:

```dockerfile
FROM alpine:3.20
ARG WANTASTIC_ARCH=amd64
RUN apk add --no-cache ca-certificates curl \
 && TAG=$(curl -fsSL https://get.wantastic.app/latest | cut -d+ -f1) \
 && mkdir -p /tmp/w \
 && curl -fsSL https://get.wantastic.app/$TAG/wantasticd-linux-$WANTASTIC_ARCH.tar.gz | tar -xz -C /tmp/w \
 && install -m 755 "$(find /tmp/w -name wantasticd -type f | head -n 1)" /usr/local/bin/wantasticd \
 && rm -rf /tmp/w \
 && wantasticd version
ENV WANTASTIC_CONFIG_DIR=/etc/wantastic \
    WANTASTIC_DNS_MODE=off
VOLUME /etc/wantastic
ENTRYPOINT ["wantasticd"]
CMD ["connect", "--config", "/etc/wantastic/config.conf", "--no-auto-update"]
```

Bauen und zuordnen (einmalig):

```bash
docker build -t wantasticd-local --build-arg WANTASTIC_ARCH=amd64 .
docker run -it --rm --hostname office-docker --cap-add NET_ADMIN --device /dev/net/tun -v wantastic:/etc/wantastic wantasticd-local genkey
```

Im Hintergrund ausführen:

```bash
docker run -d --name wantasticd --hostname office-docker --restart unless-stopped --cap-add NET_ADMIN --device /dev/net/tun -v wantastic:/etc/wantastic wantasticd-local
```

*Installieren und zuordnen: genkey gibt eine Claim URL und einen QR-Code aus und wartet dann. Nachdem du in der Konsole auf Claim Device geklickt hast, gibt es "Device claimed" aus. Drücke dann Strg+C und starte den Dienst neu.*

```
$ $ docker run -it --rm --hostname office-docker --cap-add NET_ADMIN --device /dev/net/tun -v wantastic:/etc/wantastic wantasticd-local genkey
…
…
Generated device claim key: /etc/wantastic/device-claim-key.json
Public key: Vd3hK1oQ7mR2sT9uW4xY6zA8bC0dE2fG4hJ6kL8mN0P=
Server URL: https://console.wantastic.app
Claim URL: https://console.wantastic.app/#desktop?claim_public_key=Vd3hK1oQ…%3D&wantastic_server=https%3A%2F%2Fconsole.wantastic.app

█▀▀▀▀▀█ ▄▀▄ ▀█▄ █▀▀▀▀▀█
█ ███ █ ▀█▄▀▄█ █ ███ █
█ ▀▀▀ █ ▄▀█ ▀▄ █ ▀▀▀ █
▀▀▀▀▀▀▀ ▀ ▀ █ ▀ ▀▀▀▀▀▀▀
▀█▄▀▄▀▀█▀▄█▀▄▀▀▄█▀▄▀█▄
█▀▀▀▀▀█ █▄▀▄▀█ ▀▄█ ▄▀
▀▀▀▀▀▀▀ ▀▀ ▀▀▀ ▀▀▀ ▀▀▀

2026/10/29 09:14:03 Waiting for claim. Press Ctrl+C to stop.
2026/10/29 09:15:12 Device claimed. Configuration saved to /etc/wantastic/config.conf
^C
$ $ docker run -d --name wantasticd --hostname office-docker --restart unless-stopped --cap-add NET_ADMIN --device /dev/net/tun -v wantastic:/etc/wantastic wantasticd-local
```

*Console: Claim Wantastic Device. Die Claim URL und der QR-Code füllen den Key für dich aus. Du klickst nur auf Claim Device.*

1. Claim public key ist bereits ausgefüllt
2. Wantastic server unverändert lassen
3. Auf Claim Device klicken

> **Operational note:** WANTASTIC_DNS_MODE=off verhindert, dass der Agent das DNS des Containers ändert, das Docker verwaltet. Auto-Update ist in Containern deaktiviert: Baue zum Aktualisieren das Image neu.

## Funktion prüfen

1. Führe den Statusbefehl aus. Er zeigt Status: Connected.
2. Öffne Devices in der Konsole. Das Gerät wird als Online angezeigt.

Prüfen:

```bash
docker exec wantasticd wantasticd status
docker logs --tail 20 wantasticd
```

*wantasticd status: Status: Connected und eine VPN IP bedeuten, dass der Tunnel steht.*

```
$ $ docker exec wantasticd wantasticd status
Status:        Connected
Version:       v1.0.54+377f3c0
Mode:          TUN (wantastic0)
VPN IPs:       10.200.0.14/32
Public key:    q7ZkV3m1yH0dTn8pXo2bLwR4sE6uJ9cA1fG5hK8iN0M=
Server:        wg.wantastic.app:51820
Exit node:     false
Local access:  false
Auto update:   true
Traffic:       ↓ 18.4 KiB  ↑ 9.2 KiB
Peers:         2 (direct 1, relay 1)
Uptime:        4m12s
```

*Console: Fenster Devices: Das neue Gerät erscheint unter seinem Namen und wird innerhalb weniger Sekunden Online.*

1. Nach Name suchen
2. Status zeigt Online
3. Overlay-IP stimmt mit wantasticd status überein
4. Last seen wird laufend aktualisiert

## Docker Compose

- Standardnetzwerk: Nur der Container ist im Overlay.
- network_mode: host legt wantastic0 auf den Host, sodass der Host selbst über das Overlay erreichbar ist.

compose.yaml:

```yaml
services:
  wantasticd:
    build:
      context: .
      args:
        WANTASTIC_ARCH: amd64
    image: wantasticd-local
    hostname: office-docker
    restart: unless-stopped
    cap_add:
      - NET_ADMIN
    devices:
      - /dev/net/tun:/dev/net/tun
    volumes:
      - wantastic:/etc/wantastic
    # network_mode: host   # put wantastic0 on the host itself
volumes:
  wantastic: {}
```

Einmal zuordnen, dann starten:

```bash
docker compose run --rm wantasticd genkey
# after "Device claimed": press Ctrl+C, then:
docker compose up -d
```

## Aktualisieren

Mit dem neuesten Release neu bauen:

```bash
docker build --no-cache -t wantasticd-local --build-arg WANTASTIC_ARCH=amd64 .
docker rm -f wantasticd
# then run the "Run in the background" command again (the volume keeps the claim)
```

## Weitere Installationswege

Das brauchst du nur für Automatisierung oder Sonderfälle. Die Schnellinstallation oben ist der einfachste Weg.

### Mit Token (viele Container)

Melde dich einmalig mit einem Token aus Account → Secrets im Volume an und verwende dann den run-Befehl.

Token-Anmeldung im Volume:

```bash
docker run --rm --hostname office-docker -v wantastic:/etc/wantastic wantasticd-local login --no-connect --token <TOKEN>
```

> Behandle das Token wie ein Passwort. Jeder, der es hat, kann bis zu dessen Ablauf Geräte zu deinem Konto hinzufügen.

*Console: Account → Secrets → + New Secret. Der Wert des Secrets ist das Token.*

1. Tab Secrets öffnen
2. Auf + New Secret klicken
3. Namen vergeben
4. Auf Generate klicken
5. Neues Secret kopieren

## Verify the result

- docker ps zeigt wantasticd als Up (nicht Restarting).
- docker exec wantasticd wantasticd status zeigt Status: Connected.
- Das Gerät wird unter Devices als Online angezeigt.

## Common issues

### Der Container stoppt sofort mit einem TUN-Fehler.

```
Failed to start agent: create device: create tun: CreateTUN("wantastic0") failed; /dev/net/tun does not exist
```

- **Where:** docker logs
- **Likely cause:** Der Container wurde ohne --device /dev/net/tun gestartet, oder der Host hat keinen TUN-Treiber.
- **Fix:** Lade TUN auf dem Host und verwende dann genau den run-Befehl aus der Schnellinstallation.

Auf dem Host:

```bash
sudo modprobe tun
```

### Der Container stoppt mit einem Berechtigungsfehler.

```
operation not permitted
```

- **Where:** docker logs
- **Likely cause:** Die Capability NET_ADMIN fehlt, oder die Runtime läuft rootless.
- **Fix:** Füge --cap-add NET_ADMIN hinzu. Führe den Container bei rootless Docker oder Podman als root aus.

### Der Container startet direkt nach dem Start in einer Schleife neu.

```
Config not found at /etc/wantastic/config.conf. Run `wantasticd genkey --out <key>` to create a claim key and wait for claim, or pass --wait-claim with an existing key.
```

- **Where:** docker logs
- **Likely cause:** Der Container wurde nie zugeordnet, oder er verwendet ein anderes Volume.
- **Fix:** Führe den Zuordnungsbefehl einmal mit demselben Volume-Namen aus und starte den Container dann erneut.

Zuordnen:

```bash
docker run -it --rm --hostname office-docker --cap-add NET_ADMIN --device /dev/net/tun -v wantastic:/etc/wantastic wantasticd-local genkey
docker restart wantasticd
```

### install.sh in einem Container schlägt am Ende fehl.

```
System has not been booted with systemd as init system (PID 1). Can't operate.
```

- **Where:** install.sh
- **Likely cause:** Container haben meist kein systemd.
- **Fix:** Verwende statt des Installers das Dockerfile auf dieser Seite.

### Das Log zeigt stündlich fehlgeschlagene Updates.

```
Error: no supported service manager found; refusing an unverifiable update
```

- **Where:** docker logs
- **Likely cause:** Auto-Update ist aktiv, aber ein Container hat keinen Service-Manager.
- **Fix:** Behalte --no-auto-update in CMD (wie im Dockerfile) und baue zum Aktualisieren das Image neu.

### Die Zuordnung oder die Anmeldung wird abgelehnt.

```
Login failed: account has reached its device limit — upgrade your plan or remove an existing device
```

- **Where:** wantasticd login / Konsole
- **Likely cause:** Die Geräteanzahl deines Tarifs ist ausgeschöpft. Die Konsole zeigt "You have reached the maximum number of devices for your plan." an.
- **Fix:** Lösche unter Devices ein nicht genutztes Gerät (Zeile → Delete) oder wechsle in einen höheren Tarif. Ordne das Gerät dann erneut zu.

### status meldet Running (tunnel down), oder peers zeigt HANDSHAKE never für (server).

```
Device health check failed: …
```

- **Where:** Dienst-Log
- **Likely cause:** Das Netzwerk blockiert ausgehenden UDP-Port 51820 zum Hub (wg.wantastic.app), oder DNS funktioniert nicht.
- **Fix:** Erlaube ausgehendes UDP 51820 in deiner Firewall und starte dann den Dienst neu.

DNS testen und neu starten:

```bash
nslookup wg.wantastic.app
docker restart wantasticd
```

- **Verify:** wantasticd peers zeigt für (server) einen aktuellen Handshake (zum Beispiel "8s ago").

## Continue with

- [Manual tarball install](https://wantastic.app/de/docs/install-manual): Install wantasticd by hand from the release archive on any Linux CPU (including ppc64, s390x and loong64), claim it with genkey, and add your own service.
- [Install on Debian and Ubuntu](https://wantastic.app/de/docs/install-debian-ubuntu): Install wantasticd on Debian, Ubuntu, Mint and Proxmox in 2 minutes: one command, scan a QR code, click Claim Device.
- [wantasticd CLI reference and operations](https://wantastic.app/de/docs/wantasticd): The most used wantasticd commands first, then every command and flag, environment variables, config and state paths per OS, log lines, local access, exit node, and the claim flow (genkey / --wait-claim).
- [Self-host WantasticCore](https://wantastic.app/de/docs/self-hosting): Run your own Wantastic console with one command: install, setup wizard, DNS, ports, devices and backups.
- [Connect and runtime errors](https://wantastic.app/de/docs/errors-connect-runtime): Fix service start failures, config errors, TUN problems, missing handshakes and DNS warnings.
- [Update, roll back and uninstall](https://wantastic.app/de/docs/update-and-uninstall): Update or uninstall wantasticd with one line per OS. Also: how auto-update works, turning it off, rolling back to the previous binary, and purging all data.
