Skip to content
Documentation
On this page

Self-host with Docker

Run Executor in one Docker container with an embedded database, no separate Postgres or queue, and configure health checks and stall detection.

Self-host runs the full Executor server — API, MCP endpoint, authentication, app runtime, dashboard, and an embedded PGlite database — in one Docker container on your own infrastructure (Self-host only).

Pull and start ghcr.io/usefulsoftwareco/executor-selfhost:2.0.0-beta.79 with a persistent /app/data volume on 127.0.0.1:4400, then open http://localhost:4400 to create your administrator account. No environment variables or separate Postgres, worker, or queue services are needed.

Prerequisites: Docker on Linux AMD64 or ARM64 (or Docker Desktop on macOS/Windows). For remote access beyond localhost, place a TLS reverse proxy in front of 127.0.0.1:4400 and set BETTER_AUTH_URL.

You’ll know it worked when docker logs executor-v2 prints Executor is ready at http://localhost:4400, curl -sf http://127.0.0.1:4400/health returns {"status":"ok"}, and http://localhost:4400 shows Set up Executor.

Run it

Use version 2.0.0-beta.79 on Linux AMD64 or ARM64:

docker pull ghcr.io/usefulsoftwareco/executor-selfhost:2.0.0-beta.79
docker run -d --name executor-v2 --init --restart unless-stopped \
  -p 127.0.0.1:4400:4400 -v executor-v2-data:/app/data \
  ghcr.io/usefulsoftwareco/executor-selfhost:2.0.0-beta.79

Open http://localhost:4400 and complete first-run setup. The named volume executor-v2-data retains your database, app data, and generated keys across restarts.

To follow the beta channel, use this image tag in the run command. Pull it again before recreating the container to update. Back up the volume before upgrading.

docker pull ghcr.io/usefulsoftwareco/executor-selfhost:beta

The run command publishes port 4400 on loopback only (127.0.0.1:4400). To expose it beyond this machine, terminate TLS in a reverse proxy forwarding to 127.0.0.1:4400 and pass -e BETTER_AUTH_URL=<origin> matching the exact origin users open.

On startup, the server opens its embedded database. Until that finishes, every request — including /health — receives an immediate 503 with Executor is starting. First boot initializes the database and can take a minute or more on slow disks such as a NAS. Watch progress with docker logs -f executor-v2: it logs Executor is still starting every 15 seconds, then Executor is ready at <BETTER_AUTH_URL>.

Stop the container with:

docker stop executor-v2

Health checks

/health returns HTTP 200 with {"status":"ok"} once the server is ready. Because the same thread serves /health, runs requests, and syncs storage commits to disk, a slow disk can delay /health behind a commit. In measurements with 30 apps running schedules, /health took up to 16.5 seconds on a desktop disk (99th percentile 12.9 seconds) and up to 34 seconds on a disk capped at 5 writes per second.

The Docker image includes a built-in HEALTHCHECK (--interval=30s --timeout=30s --start-period=120s --retries=3) that runs executor-host health. A server that stops answering becomes unhealthy within three minutes, and a server that never starts becomes unhealthy after about five minutes. Give external probes the same headroom:

  • Kubernetes: Default timeoutSeconds is 1, which normal disk commits on slow storage exceed. Give readiness and liveness probes a 30-second timeout:

    startupProbe:
      httpGet: { path: /health, port: 4400 }
      periodSeconds: 10
      timeoutSeconds: 10
      failureThreshold: 18 # ~3 minutes; raise to 36 (~6 minutes) on very slow disks
    livenessProbe:
      httpGet: { path: /health, port: 4400 }
      periodSeconds: 30
      timeoutSeconds: 30
      failureThreshold: 3

    On a disk throttled to 5 writes per second, first-boot database creation took 204 seconds, so raise startupProbe.failureThreshold (for example to 36) on storage that slow.

  • Railway: Probes /health only during startup. Set the healthcheck path to /health and startup timeout to 120 seconds.

  • Docker Compose or other supervisors: Allow timeout: 30s, interval: 30s, and retries: 3.

When the server stops answering

Everything the server runs shares one main thread, so app code that never returns or another fault blocking that thread stops the whole instance from answering. Docker marks an unhealthy container but does not restart it on its own.

Once the server is ready, executor-host checks every second whether the server answered and how its main thread spent that second. It considers the server stalled when, since the last answer, the thread was busy for EXECUTOR_HOST_STALL_SECONDS seconds (60 by default; 0 disables the check; max 3600), or sleeping or stopped for five times as many. A busy second uses at least half a CPU-second (scaled down proportionally if the container has less than one CPU). Disk I/O wait, paused containers, and sleeping hosts are excluded, so slow disks do not trigger it.

By default, the watchdog only logs Executor stopped responding: (followed by Executor answered again if it recovers). Set EXECUTOR_HOST_STALL_RESTART=true to make executor-host stop the server and exit with an error so Docker’s restart policy restarts it. Because the watchdog cannot distinguish long legitimate work from a hung thread, observe logs in default log-only mode first before enabling restart. Restarting drops open sessions, in-flight calls, and paused approvals while keeping stored data.

Always run with --restart unless-stopped or --restart always rather than --restart on-failure: the server can exit cleanly if something inside the container sends its runtime a stop signal, and on-failure would leave it stopped.

Configure it

Set BETTER_AUTH_URL, reverse-proxy trust (EXECUTOR_TRUSTED_PROXIES), Worker and MCP client limits, private fetch, and runtime environment variables to match your infrastructure. See Deploy, proxy, and tune self-host.

Deploy on Railway

Deploy the published image on Railway with a /app/data volume, port 8080, and /health check. See Deploy, proxy, and tune self-host.

Private access with Tailscale

Expose the loopback container over HTTPS on your tailnet with tailscale serve (or publicly with Funnel). See Deploy, proxy, and tune self-host.

Serving app web pages

Set EXECUTOR_APP_UI_BASE_URL with wildcard DNS and TLS to serve apps that ship a web UI. See Deploy, proxy, and tune self-host.

Connect an agent

Point MCP clients at <your origin>/mcp and tune EXECUTOR_MCP_CLIENTS and EXECUTOR_MCP_CLIENTS_PER_USER if many agents connect concurrently. See Add an MCP client and Deploy, proxy, and tune self-host.

Storage

Persistent data and generated keys live in /app/data, while bundled telemetry lives separately in /app/motel-data. See Storage, backups, and updates.

Updates

Owners and admins see an Update available notice in the sidebar when a newer release ships; back up /app/data before recreating the container. See Storage, backups, and updates.

Move from a local Executor

A new self-host container starts empty; re-install apps, reconnect accounts, and switch MCP clients over. See Storage, backups, and updates.

Running without Docker

Run the native Bun development server from a source checkout without Docker or Postgres. See Deploy, proxy, and tune self-host.

Build from source

Build and run the self-host image from the public repository with Docker Compose. See Deploy, proxy, and tune self-host.

Limits

  • The container runs one embedded PGlite database on a single volume — keep one replica per /app/data volume.
  • Each self-host instance has one organization; self-host does not include Cloud’s Google, GitHub, ChatGPT, or passkey sign-in buttons (configure Sign-in and OIDC SSO instead).
  • First boot on slow storage can exceed 60 seconds; allow at least 120 seconds for startup probes.

Was this page helpful?