wtree Cloud

Install manually

Create the wtree Cloud services yourself, on a new server or an existing Docker Swarm, and maintain Traefik.

Set up the panel, database and Traefik with Docker commands when you need control the installer doesn't give you. Service names, the network, secrets and /etc/w3panel paths below must stay as written, because the panel looks them up by those names.

Before you start

  • Root access on a Linux host that isn't a container. Ports 80, 443 and 3000 free.
  • Docker installed. On a new server, install it with curl -sSL https://get.docker.com | sh.
  • The image ghcr.io/w3panel/w3panel is public. For a private registry or your own build, run docker login <registry> and add --with-registry-auth to docker service create.

Settings you can change

SettingWhat it does
PORTPanel port, to avoid conflicts
TRAEFIK_PORTTraefik HTTP port
TRAEFIK_SSL_PORTTraefik HTTPS port
ADVERTISE_ADDRIP address Swarm advertises
RELEASE_TAGImage tag: latest, sha-<commit> or a version such as v0.2.2
DATABASE_URLExternal database instead of the bundled PostgreSQL
TZTimezone

Install

Skip this step if the server already runs a Swarm. Do not use the installer there either: it makes the node leave the current swarm, which disrupts existing services.

Initialize Swarm. ADVERTISE_ADDR must be reachable by every node that will join.

docker swarm init --advertise-addr <ip>

Create the network and the configuration directory:

docker network create --driver overlay --attachable w3panel-network
mkdir -p /etc/w3panel
chmod 755 /etc/w3panel

Create the secrets for the database password and the auth key:

openssl rand -base64 32 | tr -d "=+/" | cut -c1-32 | docker secret create w3panel_postgres_password -
openssl rand -hex 32 | docker secret create w3panel_auth_secret -

Create the PostgreSQL service:

docker service create \
  --name w3panel-postgres \
  --constraint 'node.role==manager' \
  --network w3panel-network \
  --env POSTGRES_USER=w3panel \
  --env POSTGRES_DB=w3panel \
  --secret source=w3panel_postgres_password,target=/run/secrets/postgres_password \
  --env POSTGRES_PASSWORD_FILE=/run/secrets/postgres_password \
  --mount type=volume,source=w3panel-postgres,target=/var/lib/postgresql/data \
  postgres:16

To use your own PostgreSQL, skip this step. In the next one, replace POSTGRES_PASSWORD_FILE and its secret with -e DATABASE_URL=postgres://user:password@host:5432/dbname. By default the panel connects to w3panel-postgres:5432 with user and database w3panel. Override these individually with POSTGRES_HOST, POSTGRES_PORT, POSTGRES_USER and POSTGRES_DB.

Create the panel service:

docker service create \
  --name w3panel \
  --replicas 1 \
  --network w3panel-network \
  --mount type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock \
  --mount type=bind,source=/etc/w3panel,target=/etc/w3panel \
  --mount type=volume,source=w3panel,target=/root/.docker \
  --secret source=w3panel_postgres_password,target=/run/secrets/postgres_password \
  --secret source=w3panel_auth_secret,target=/run/secrets/w3panel_auth_secret \
  --publish published=3000,target=3000,mode=host \
  --update-parallelism 1 \
  --update-order stop-first \
  --constraint 'node.role == manager' \
  -e POSTGRES_PASSWORD_FILE=/run/secrets/postgres_password \
  -e BETTER_AUTH_SECRET_FILE=/run/secrets/w3panel_auth_secret \
  ghcr.io/w3panel/w3panel:latest

Wait about 10 seconds. The panel generates the Traefik configuration in /etc/w3panel/traefik on first boot. Then start Traefik:

docker run -d \
  --name w3panel-traefik \
  --restart always \
  -v /etc/w3panel/traefik/traefik.yml:/etc/traefik/traefik.yml \
  -v /etc/w3panel/traefik/dynamic:/etc/w3panel/traefik/dynamic \
  -v /var/run/docker.sock:/var/run/docker.sock:ro \
  -p 80:80/tcp \
  -p 443:443/tcp \
  -p 443:443/udp \
  traefik:v3.8.0
docker network connect w3panel-network w3panel-traefik

If your swarm already runs a reverse proxy on ports 80 or 443, free them or change the published ports of w3panel-traefik. wtree Cloud manages its own Traefik to route the domains of your applications.

Verify

Open http://<server-ip>:3000 and create the administrator account.

Proxmox LXC

Docker services in a Proxmox LXC container need --endpoint-mode dnsrr because of networking limits. The installer adds it automatically. For a manual install, add it to each docker service create, for example the PostgreSQL one.

Timezone

docker service update --env-add TZ=America/New_York w3panel

Upgrade the panel

sudo wtree-cloud update
sudo wtree-cloud update --version v0.2.3

The second form switches to a specific tag. Other installer options are listed in Install wtree Cloud.

Update Traefik

wtree Cloud never updates Traefik during a panel upgrade, to avoid unexpected downtime. Check and update it from the dashboard instead.

Open Servers, choose This server or a remote server, then open the Traefik menu in the page header and choose Check version.

The dialog shows the running version and the version your release recommends. When Traefik is older, click Update. wtree Cloud pulls the new image first, recreates the container with the same environment variables, port mappings and networks, and restores the previous container if the new one fails to start. Applications can be unreachable for a short time. traefik.yml, the dynamic configuration and acme.json are mounted from the host and are kept. Changes made to the container outside wtree Cloud (extra mounts, labels, static IPs, ports bound to a host IP) are not carried over.

The update is offered only for the official image when it is older than recommended. Start a stopped Traefik with Reload from the same menu first. A custom image is never updated by wtree Cloud.

Update by hand

Replace v3.8.0 with the version you want.

docker rm -f w3panel-traefik
docker run -d \
  --name w3panel-traefik \
  --restart always \
  -v /etc/w3panel/traefik/traefik.yml:/etc/traefik/traefik.yml \
  -v /etc/w3panel/traefik/dynamic:/etc/w3panel/traefik/dynamic \
  -v /var/run/docker.sock:/var/run/docker.sock:ro \
  -p 80:80/tcp \
  -p 443:443/tcp \
  -p 443:443/udp \
  traefik:v3.8.0
docker network connect w3panel-network w3panel-traefik

Some Traefik versions have breaking changes that wtree Cloud's configuration may not support, which shows up as 404s on applications with domains. Read the Traefik release notes before upgrading.

Next steps

On this page