Map the services and volumes
The bridge owns the WhatsApp connection and serves its API on loopback inside its network namespace. The server shares that namespace, so it can reach the API without publishing the bridge port. Caddy forwards the public login path to the bridge and other requests to the MCP service. Only ports 80 and 443 need to be publicly reachable for the documented HTTPS setup.
Both application containers run as user 65532 with read-only root filesystems and no capabilities. They share the wa-data volume for the message database, downloads and exports. Only the bridge mounts wa-session, which holds the linked-device session keys. The database encryption key is supplied separately through a Docker secret. Those three pieces have different roles when backing up or restoring.
Prepare a host and database key
Use a Linux host with Docker Engine and the Compose plugin. Point the DNS record for your domain or subdomain at that host. In the repository's deploy/docker directory, copy env.example to .env, restrict the permissions and set WA_MCP_DOMAIN. Set TZ to the intended time zone because quiet hours, schedules and the daily briefing use it.
Run the provided secrets/make-key.sh script to create the 32-byte key. It sets the owner and permissions needed by the containers and may request sudo to change ownership. Keep a protected copy of the key away from the server. Losing it means losing access to encrypted message fields, even if the data volume itself survives.
Start the stack and verify health
From the deployment directory, start Compose with the caddy profile. Wait for the bridge and server to report healthy in compose ps and for the proxy to obtain its certificate. Check the root health URL for your domain before moving on to login. The server health check also checks the bridge.
docker compose --profile caddy up -d --build
docker compose ps
For a test that requires no WhatsApp account, use the documented preview override. It starts the bridge with fake codes and lets you exercise the services without a real login. A healthy preview confirms the services can start and communicate. For a real account, continue with the normal configuration and verify that the bridge is both connected and logged in.
Pair the device and authorize a client
Run docker compose exec bridge wa-bridge login-url to get a one-time HTTPS link. Open it and scan the QR code from Linked devices on your phone. If you need to revisit the login window, generate a fresh link. Keep the address private because it grants access to the login page.
For a client using a static token, create a token in the server container and give it a device-specific name. The value is shown once. Configure the client with the public HTTPS /mcp address and its bearer credential. A claude.ai connector can use OAuth with owner approval. The consent link for the documented configuration is available through the server logs.
Plan a restorable backup
Stop the stack before copying the shared data volume. Back up the session volume if you want to preserve the existing phone link, and encrypt that archive because it contains device keys. Store the database key separately from the data backup. Without the session volume you need to pair the phone again. Without the encryption key a new pairing will not decrypt the old message fields.
Questions
Can I test WhatsApp MCP in Docker before linking a number?
Yes. The preview override starts the stack with fake login codes. Check service health there, then use the normal configuration for real pairing.
Do I need a desktop keystore in Docker?
No. The supplied container configuration uses keyfile mode with a Docker secret. A passphrase is another documented option. Both application processes need access to the key material for their own roles.
How do I customize the container configuration?
Copy the supplied container configuration to the documented local config.json, edit the copy and mount it read-only in both services. Preserve the paths under /data and the documented listening addresses so the services can still communicate.
Project documentation ยท server.md