Deploy with Dokploy
Deploy Duobox Server to Dokploy from a Dockerfile with HTTPS, persistent storage, and health checks.
This guide describes one production deployment path: build Duobox Server from a Dockerfile and let Dokploy manage the container lifecycle, domain, HTTPS, logs, and restarts.
To declare the build, configuration, and persistent storage in one Compose file, see Deploy with Dokploy Compose.
Duobox Server stores one SQLite database and local bare Git repositories. Keep the replica count at 1 and persist the entire /data directory because one data directory must be owned by exactly one Server instance.
Requirements
Prepare the following:
- a Dokploy instance;
- a public domain such as
spaces.example.com; - a Downcity Federation URL, Bureau Token, and City ID;
- a Git repository for the Dockerfile.
1. Create the Dockerfile
Add this Dockerfile at the root of the deployment repository:
FROM node:22-bookworm-slim
RUN apt-get update \
&& apt-get install -y --no-install-recommends git curl ca-certificates \
&& npm install -g @duobox/cli@latest \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir -p /data && chown node:node /data
ENV DUOBOX_REMOTE_HOST=0.0.0.0
ENV DUOBOX_REMOTE_PORT=4178
ENV DUOBOX_REMOTE_DATA=/data
USER node
VOLUME ["/data"]
EXPOSE 4178
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
CMD curl -fsS http://127.0.0.1:4178/v1/info || exit 1
CMD ["duobox", "server", "start", "--foreground"]The container must use server start --foreground. Duobox remains the foreground main process while Dokploy owns shutdown, restarts, and logs.
Pin the CLI version in production. Upgrade by changing the version in the Dockerfile and rebuilding instead of installing dependencies every time the container starts.
2. Create the Application
Create an Application in Dokploy:
- connect the Git repository containing the Dockerfile;
- select
Dockerfileas the build type; - set the container port to
4178; - keep the replica count at
1; - mount a persistent volume at
/data; - route
spaces.example.comto the Application and enable HTTPS; - set the health check path to
/v1/info.
Do not configure /data as ephemeral storage. The same volume must remain attached after container rebuilds.
3. Configure environment variables
Add these values to the Application environment:
DOWNCITY_FEDERATION_URL=https://base.downcity.ai
DOWNCITY_BUREAU_TOKEN=replace-with-your-bureau-token
DOWNCITY_CITY_ID=duobox
DUOBOX_REMOTE_HOST=0.0.0.0
DUOBOX_REMOTE_PORT=4178
DUOBOX_REMOTE_URL=https://spaces.example.com
DUOBOX_REMOTE_DATA=/dataImportant details:
DUOBOX_REMOTE_HOSTmust be0.0.0.0so Dokploy can reach the container port;DUOBOX_REMOTE_URLmust be the public HTTPS origin, notlocalhost, a container name, or an internal port;- keep
DOWNCITY_BUREAU_TOKENin Dokploy as a secret and never commit it to Git.
4. Deploy and verify
Start the deployment and wait for the health check to pass. Verify the public endpoint from outside Dokploy:
curl https://spaces.example.com/v1/infoA successful request returns the Duobox Server information. If the health check fails, inspect the Application Logs and verify the port, environment variables, and Federation connectivity.
5. Link Organizations and manage access
Run administrative commands in the Dokploy Application Terminal:
duobox login
duobox server organization list
duobox server organization link <organization-id-or-key>
duobox server organization access set <organization-id> <user-id> --role editorThe active Federation user must be allowed to update the Organization Server URL. Membership governance remains in Federation.
Data, backups, and upgrades
/data contains both:
server.dbfor Spaces, project ACL, and audit records;repositories/for all Remote Space Git data.
Back up the entire volume as one unit. Backing up only the database or only the repositories can produce inconsistent data.
To upgrade:
- back up the
/datavolume; - change the pinned
@duobox/cliversion in the Dockerfile; - redeploy from Dokploy;
- keep the existing
/datavolume attached; - verify
/v1/infoand inspect the logs.
Common mistakes
- setting replicas above
1, which makes multiple processes share SQLite and repositories; - failing to persist
/data, which loses Spaces, project ACL, and Git history after a rebuild; - listening on
127.0.0.1, which prevents Dokploy from reaching the container port; - using an internal address as
DUOBOX_REMOTE_URL, which makes Organization Space and Git endpoints unreachable; - buffering Git requests or enforcing a proxy body limit below the Server limit;
- deploying where the Federation cannot be reached from the container.