Use Docker with Faheem Code
Use Docker when you want the Faheem Code distribution and its backend services to run in a container rather than directly on your host. The official image packages the Canvas client, Agent Server, Automation Server, and ingress in one container. Agent Server and its tools can access only the project directories and other resources you expose to the container.
Prerequisites
- Docker installed and running (Docker Desktop on macOS/Windows, or Docker Engine on Linux)
- Faheem Code installed locally (if connecting from another instance) — see Setup
Run the official image
Mount a persistence directory for settings, secrets, and conversation history, and a projects directory for workspace access.
mkdir -p ~/projects ~/.faheem-code
docker run -it --rm \
-p 8000:8000 \
-v ~/.faheem-code:/home/faheemcode/.faheem-code \
-v ~/projects:/projects \
ghcr.io/smart-national-solution/faheem-code-app:latest
New-Item -ItemType Directory -Force -Path "$env:USERPROFILE\.faheem-code", "$env:USERPROFILE\projects" | Out-Null
docker run -it --rm `
-p 8000:8000 `
-v "$($env:USERPROFILE)\.faheem-code:/home/faheemcode/.faheem-code" `
-v "$($env:USERPROFILE)\projects:/projects" `
ghcr.io/smart-national-solution/faheem-code-app:latest
Faheem Code is now available at http://localhost:8000/canvas. The backend base URL remains http://localhost:8000, and the agent can access any project under the mounted /projects path.
Environment variables
Configuration is passed via -e flags on docker run:
| Variable | Purpose |
|---|---|
PORT | Ingress port inside the container (default 8000). Map it with -p <host>:<PORT>. |
LOCAL_BACKEND_API_KEY | API key for the server. Auto-generated and persisted if not set. |
FC_SECRET_KEY | Secret used to protect stored settings and secrets. |
Let the agent use Docker
By default the agent cannot run containers: docker is installed in the image, but the
daemon cannot start inside an unprivileged container. If the agent tries, it fails with
error creating default "bridge" network: operation not permitted.
That matters for tasks where a container is part of the workflow — building a Dockerfile
and running it to confirm the change works, bringing up a docker compose stack to
reproduce a bug, or using a toolchain that is only published as an image. Without a
daemon the agent can edit those files but cannot verify them.
To enable it, start the container with --privileged:
docker run -it --rm \
--privileged \
-p 8000:8000 \
-v ~/.faheem-code:/home/faheemcode/.faheem-code \
-v ~/projects:/projects \
ghcr.io/smart-national-solution/faheem-code-app:latest
Verify from inside the container:
docker exec -it <container> docker info
Connect from the frontend
Start the frontend separately and point it at the container:
faheem-code --frontend-only
Then add the Docker backend:
- Click the backend switcher → Manage Backends → Add Backend.
- Fill in:
- Name — e.g.
docker-backend - Host / Base URL —
http://localhost:8000 - API Key — the
LOCAL_BACKEND_API_KEYvalue (check container logs if auto-generated)
- Name — e.g.
- Save and select it as the active backend.
Related guides
- Connect and Manage Backends
- Local Backend
- VM / Self-Hosted Installation
- Kubernetes (Helm)
- Running Docker in the Agent Sandbox — how Enterprise does this without
--privileged