In this guide
Install & secure
Give Den a secure home
Start on loopback. Create your independent owner, protect access, and verify the boundaries before you manage real applications.
This guide describes the source-based setup in the reviewed Den repository. The commands are documented in that source, but were not run as an installation rehearsal for this guide. It does not provide a one-click installer or certify a production deployment. Check the files and requirements in your approved revision.
Prepare your host
You need control of the host terminal and Docker configuration, not just a dashboard account. Den's documented host path uses Docker Desktop with the WSL2 Linux engine and Docker Compose with use_api_socket support. This guide does not establish support for other host setups or a minimum Docker version.
- Use a trusted, maintainer-approved Den source checkout. Confirm its revision and read its README before running its Compose configuration. Repository access and image-pull access must work for your account; public access is not assumed.
- Check that Docker is running with Linux containers and that Compose supports the features in the selected revision. The source build needs access to its dependency and image sources.
- Reserve the intended port and enough disk space for Den state, builds, repositories, application data and backups. This guide does not prescribe a universal memory or disk minimum.
- Keep the host clock synchronized. Time-based MFA and signed operations depend on accurate time.
- Store installation configuration and recovery material securely. Do not commit
.env, put secrets in shell arguments, or paste them into logs or support messages.
Already running Den? Stop here. This is a new-installation guide, not an update or recovery procedure. The base Compose project is named den; running it on the same Docker engine can target an existing installation. Do not create a second setup over its volumes, replace its keys, or use a fresh source build to bypass a held update.
Choose an access mode
Use the base docker-compose.yml with one access-mode override. Local, Cloudflare and standalone HTTPS are separate configurations, not layers to combine.
The agent has no published port and is the only Den component given Docker API access. Docker access remains host-administrative. Do not expose the agent or Docker API to make remote access work.
Start locally
Use an isolated, new installation. The local profile keeps the manager on IPv4 loopback and leaves the deployment agent internal.
Prepare the local configuration
From your reviewed Den checkout, create
.envfrom.env.local.example. Do not overwrite an existing file. Replace every secret placeholder with a different securely generated random value of at least 32 characters.SESSION_ENCRYPTION_KEY- Protects owner MFA and other session-related encrypted state. Preserve it with the manager database.
AGENT_HMAC_SECRET- Authenticates manager-to-agent communication. Both services must use the matching value.
WEBHOOK_SECRET_ENCRYPTION_KEY- Protects stored webhook signing secrets. Keep it with the installation's recovery material.
Keep the local template's loopback origin and local settings. Do not enable proxy trust or expose this profile through a public proxy. Local imports require this local profile, the enabled import setting, and sign-in as the Den owner.
Build and start the two services
Run the source-documented command in the Den checkout. It builds and starts this installation, so review the intended Docker engine and project first.
Host terminal · new local installationdocker compose -f docker-compose.yml -f compose.local.yml up -d --buildWait for Docker's manager and agent health checks. Open
http://127.0.0.1:3100in a browser on the host. A fresh database shows Create the Den owner; the web page does not accept owner setup credentials.Expected: manager bound to
127.0.0.1:3100, no published agent port, and a locked first-run page until the owner is initialized.
If the local start fails
Check the Docker engine, Compose feature support, image/dependency access, port conflict and exact configuration error. Read manager and agent logs locally, redacting them before sharing. Do not switch to a public bind, remove state volumes, reuse placeholder secrets or bypass a security check to get past the failure.
A running container is not enough: inspect its health result and the actual port mapping. If the port was already occupied, identify the existing service before changing anything.
Create and protect the owner
The Den owner is independent of Attic and every managed application. There are no default credentials, and the public website's Account link opens Attic, not Den operator sign-in.
Create the owner in an interactive terminal
On the host, from the intended Den checkout, run the documented bootstrap command. It targets the running manager and prompts for the owner's email and password; password input is hidden. Use a unique password with at least 12 characters. Do not pipe credentials into this command or put the password in arguments or environment variables.
docker compose exec manager node services/control/dist/admin.js initSave the single-use terminal recovery code offline when it is displayed. It is shown only once. Then sign in as the Den owner in the local dashboard. If Den reports an owner already exists, do not erase the database to repeat setup.
Enable an authenticator
- Sign in as the built-in owner and open Security. The page is titled Account security.
- Enter your current password and choose Set up authenticator.
- Scan the QR code in a time-based authenticator app, or use Enter a setup key manually. Keep the QR image and setup key private.
- Enter the current six-digit code and choose Enable authenticator. Enrollment expires after ten minutes and belongs to the session that started it. Scanning alone does not enable MFA.
- Save all ten one-use MFA recovery codes, then confirm I have saved my recovery codes. These codes work alongside the password and are different from the terminal recovery code.
- Choose Return to sign in. Enabling MFA signs out all sessions. Wait for the next authenticator code if you just used the current one, then verify a fresh sign-in with both factors.
Keep access independent. Verify the Den owner works before enabling optional Attic administrator sign-in. Owner MFA does not automatically protect Attic accounts. Required-owner-MFA mode cannot be combined with Attic sign-in.
Changing MFA or encountering a limit
Replacing recovery codes invalidates the old set. Enabling, disabling or replacing MFA recovery codes revokes all sessions. Security changes require the current password and, once enabled, an authenticator or recovery code. Required-MFA mode does not offer dashboard disabling.
Owner verification has a persistent budget of ten attempts per five-minute account-wide window, including successful checks and enrollment operations. Per-route limits also apply. Follow the reported retry time; do not repeatedly submit codes or refresh a throttled page. Keep the host and authenticator clocks correct.
Set up remote access
Remote access is an additional host-security task. Choose one path below. Before changing an existing local setup, back up its state and configuration, preserve its three independent keys, and confirm your recovery access. Do not remove named volumes.
Production prerequisites apply to both paths. Use an exact HTTPS CONTROL_PUBLIC_ORIGIN with no path or trailing slash, secure cookies, and the selected access guard. The production agent requires POSTGRES_IMAGE pinned to an approved SHA-256 digest; the local postgres:17 tag is not sufficient. Do not invent or copy a placeholder digest.
Option A
Cloudflare Access + tunnel
This path needs a configured Cloudflare Access application, an existing cloudflared connector, and an external Docker network shared with the manager. The Compose override does not create a connector or configure your Access policy.
- For a new remote setup, use
.env.exampleas the configuration reference. For a local installation being moved to remote access, preserve the existing file and keys and deliberately apply the remote settings instead of overwriting it. - Set the exact dashboard HTTPS origin,
CF_ACCESS_TEAM_DOMAINandCF_ACCESS_AUDIENCEfrom the intended Access application. The remote mode usesCF_ACCESS_REQUIRED=true,COOKIE_SECURE=trueandTRUST_PROXY=true. Keep access restricted to the intended tunnel path. - Set
NODE_ENV=productionandLOCAL_DATA_IMPORTS=falsewhen converting from the local template. The remote override sets production mode for the manager only; the agent reads it from.env. SetEDGE_NETWORK_NAMEto the existing reviewed edge network if it is notedge; create the intended network only if it does not already exist. Keep Attic sign-in disabled unless you separately configure and verify it. - Use the remote override instead of the local or standalone override:
docker compose -f docker-compose.yml -f compose.remote.yml up -d --buildInitialize the independent owner from the host if this is a fresh installation. On the shared edge network, route the dashboard hostname to http://manager:3100 and protect it with Cloudflare Access. Den validates the Access JWT itself as well as requiring Den sign-in.
If you later enable GitHub webhooks, use the separately configured WEBHOOK_PUBLIC_BASE_URL. Its webhook route uses GitHub's SHA-256 signature rather than an interactive Access login. Do not remove Access protection from the dashboard to make webhooks work.
Verify externally: the expected Access policy runs, Den still requires sign-in, and neither the manager nor the agent is directly reachable through an unintended route. DNS, TLS and the tunnel must be checked on the destination host.
Option B
Standalone HTTPS + required owner MFA
This path uses an HTTPS reverse proxy on the host. Enroll and test owner MFA in local mode first: required-MFA startup refuses to run without it.
- Set
CONTROL_PUBLIC_ORIGINto your exact HTTPS origin. Preserve all three independent keys and configure the approved PostgreSQL image digest. - Configure the host proxy to forward the exact dashboard hostname to
http://127.0.0.1:3100. It must have a valid certificate, redirect HTTP to HTTPS, preserve the request origin and cookies, and never cache/api/*. - Expose only the HTTPS proxy to the internet. Do not forward port 3100, the agent port, or the Docker API.
- Use the standalone override instead of the local or Cloudflare override:
docker compose -f docker-compose.yml -f compose.public.yml up -d --buildThe override requires owner MFA, disables Cloudflare Access, Attic sign-in and local imports, enables secure cookies, and limits sessions to one day. It keeps TRUST_PROXY=false. Do not enable blanket proxy trust to work around rate limits.
Verify externally: a valid certificate, sign-in requiring both factors, rejection of protected API requests without a session, and no direct public access to manager, agent or Docker. This is a single-owner profile, not public registration or multi-tenant hosting.
Keep a recovery path
Save the right recovery material before you need it. Den owner access recovery is separate from recovering a held update or restoring a lost host.
Lost authenticator access
Use the owner password plus one unused MFA recovery code at sign-in. Each code works once. If you still have access, replace the set through Security and store the new codes before signing in again.
Lost owner password
Host-level recovery needs the original terminal recovery code, not an MFA code. It resets the password, rotates the terminal code, clears MFA and its recovery codes, and revokes every session.
Host-terminal password recovery
This changes security state. Use it only for the intended installation with host access and its saved terminal recovery code. For a required-MFA installation, first return to a protected loopback-only local profile with the existing state, then re-enroll MFA before restoring remote access. Do not leave a local recovery profile publicly proxied.
docker compose exec manager node services/control/dist/admin.js reset-passwordThe interactive prompts require the terminal recovery code and a new password. Store the replacement terminal code, then set up the authenticator again. Required-MFA mode will not accept sign-in after this reset until enrollment is restored in local mode.
If both access and all usable recovery methods are lost, restoring the manager state from backup is a separate recovery task. Do not delete the database, invent a new identity, or remove a maintenance hold. Protect the matching configuration and encryption keys as well as the state.
Back up more than the account. Keep protected copies of installation configuration and required keys alongside an appropriate state/data backup plan. A profile export does not include the Den owner password, sessions or host .env keys; it is not a complete host recovery package.
Verify your installation
Work through the checks for your chosen access mode before adding a real application. Record what you observed, not just which command finished.
Installation acceptance checklist
- Manager and agent health checks pass on the intended Docker engine and project.
- The manager has only the intended access path; the agent and Docker API are not publicly reachable.
- The independent Den owner can sign in without relying on a managed app.
- MFA has been confirmed, a new sign-in works, and both kinds of recovery material are saved separately and securely.
- The origin, cookies, proxy/tunnel and access guard match the chosen mode. Remote checks have been made from outside the host/network where applicable.
- The existing keys and state are protected, with a recovery plan you understand.
Know what this setup does not install
Starting the manager and agent does not configure the independent updater, its protected execution scope, release trust, status/recovery routes or matched-state checkpoints. The source contains updater components, but packaging and a published release do not establish readiness on your host.
Available release, installed version and update readiness are three separate facts. Do not infer the running version from a package version or release listing. Updating Den is also separate from Deploy latest version for a managed application.
Independent updater enrollment and routine update approval need a dedicated host-operator plan. Continue with updater prerequisites and routine update approval. For held-update and host-loss branches, use held-update diagnosis and matched host recovery safeguards. None are enabled by these installation commands.
Ready for your first disposable app
Once access and recovery are verified, return to the first-deployment checklist. Start small and check the final operation, running services and applicable health evidence.
Your first deployment