Docker Deploy
Docker is currently the only recommended deployment path for WG Free Mesh.
This is not a single-process web application. It includes the console, backend API, database, EMQX, MQTT authorization, client TLS certificates, downloadable artifacts, snapshots, and a unified gateway. The Docker layout keeps these components in a predictable network and directory structure, and it automatically handles most EMQX details that are easy to misconfigure manually.
For production, read Environment before starting. If the service will be exposed publicly, also read Reverse Proxy and publish the console and API through HTTPS.
Clone the Repository
Clone the project and enter the repository directory first:
git clone https://github.com/xinghenLuyus/wg-free-mesh.git
cd wg-free-meshChoose a Database
SQLite and PostgreSQL use the same application logic. Snapshots are exported at the application layer, so data can be migrated between the two modes.
| Mode | Best for | Notes |
|---|---|---|
| SQLite | Local use, lightweight deployments, single-admin setups, small node counts | Data is stored directly in the project's src/data directory, making it easy to inspect, back up, and migrate. |
| PostgreSQL | Long-running services, multi-user use, higher concurrency, production | Starts an additional PostgreSQL database container and is better suited to long-running or production deployments. |
Start with SQLite
Enter the SQLite deployment directory:
cd docker/sqliteCopy the environment configuration file:
cp .env.example .envThen edit .env.
At minimum, confirm the following:
Change the passwords and keys required for production.
Set
WFM_PUBLIC_ORIGINto the actual access URL.
For example:
WFM_PUBLIC_ORIGIN=https://wfm.example.comIf you only need the web console and do not need client remote control or MQTT services, you can disable them:
WFM_ENABLE_MQTT_SERVICES=false
COMPOSE_PROFILES=See Environment for the full explanation.
After configuring .env, start the deployment:
docker compose up -dDefault URL:
http://localhost:8000Start with PostgreSQL
Enter the PostgreSQL deployment directory and copy the environment configuration file:
cd docker/postgres
cp .env.example .envEdit .env. At minimum, change:
The PostgreSQL database password.
The EMQX password.
The shared secret.
WFM_PUBLIC_ORIGIN.
For example:
WFM_PUBLIC_ORIGIN=https://wfm.example.comIf you only need the web console and do not need client remote control or MQTT services, you can disable them:
WFM_ENABLE_MQTT_SERVICES=false
COMPOSE_PROFILES=See Environment for the full explanation.
After configuring .env, start the deployment:
docker compose up -dDefault URL:
http://localhost:8000After Startup
Open the console and complete administrator initialization. Then create a config, add nodes, download the client, and bind nodes.
If MQTT is enabled, EMQX may become ready later than the backend. Seeing temporary EMQX or node waiting states is normal. Once EMQX is online, the backend synchronizes accounts, authorization, and client connection data.
Image Version
Docker deployment uses the latest image by default. latest points to the current public recommended version. Before the first stable release, it points to the newest RC release.
Most deployments do not need to manage image tags. Start normally:
docker compose up -dIf you need a fixed production version and do not want to follow latest, set the image tag in .env:
WFM_IMAGE_TAG=1.0.0Pre-release versions can also be pinned:
WFM_IMAGE_TAG=1.0.0-rc.1