Prerequisites
You’ll need:- Docker installed (get Docker)
- Python 3.10+ for the CLI client
- Lerim installed:
pip install lerim
Starting Lerim
Once you’ve runlerim init and added projects, start the Docker service:
- Reads
~/.lerim/config.tomlfor your agent and project configurations - Generates a
docker-compose.ymlfile in~/.lerim/ - Pulls the pre-built image from GitHub Container Registry (GHCR)
- Starts a container with volume mounts for:
- Agent session stores (
~/.claude/,~/.codex/, etc.) - Project directories (for
.lerim/memory folders) - Global Lerim data (
~/.lerim/)
- Agent session stores (
The container runs
lerim serve, which combines the HTTP API, dashboard, and daemon loop in a single process.First-time output
Stopping Lerim
Stop the Docker container:Viewing logs
Tail the container logs to see sync activity, extraction results, and errors:tail -f):
Ctrl+C to stop following.
Log output example
Container lifecycle
Updating configuration
When you add or remove projects, Lerim automatically recreates the container to update volume mounts: The same happens when removing projects:Manual restart
If you need to restart Lerim manually (e.g., after editing config files):Volume mounts
Lerim mounts these directories into the container:| Host path | Container path | Purpose |
|---|---|---|
~/.lerim/ | /root/.lerim/ | Global config and data |
~/.claude/ | /root/.claude/ | Claude Code sessions |
~/.codex/ | /root/.codex/ | Codex CLI sessions |
~/Library/Application Support/Cursor/ | /root/.cursor/ | Cursor sessions |
~/.local/share/opencode/ | /root/.opencode/ | OpenCode sessions |
| Project directories | /projects/<name>/ | Repo-specific .lerim/ folders |
Paths vary by platform (macOS, Linux, Windows). Lerim automatically detects the correct paths for your system.
Building locally
By default,lerim up pulls the pre-built image from GHCR. For development or custom builds, use the --build flag:
Dockerfile instead of pulling from the registry.
Dockerfile reference
The official Lerim Dockerfile:Healthcheck
The container includes a healthcheck that pings/api/health every 30 seconds. Check container health:
Using the dashboard
With Docker running, the dashboard is served at:Querying from CLI
With the Docker service running, these commands connect to the HTTP API:lerim serve if running natively).
Troubleshooting
Port 8765 already in use
Port 8765 already in use
Another service is using port 8765.Solution: Stop the conflicting service or change Lerim’s port in Then restart:
~/.lerim/config.toml:Container exits immediately
Container exits immediately
Check logs for errors:Common causes:
- Missing API keys (
OPENROUTER_API_KEY,OPENAI_API_KEY, orZAI_API_KEY) - Invalid config in
~/.lerim/config.toml - Permission issues with mounted volumes
Memories not updating
Memories not updating
Verify the daemon is running:Force a sync:Check logs for extraction errors:
Docker not found
Docker not found
Install Docker from docs.docker.com/get-docker.Alternatively, run Lerim natively without Docker. See the Native workflow guide.
Daemon behavior
Inside the Docker container,lerim serve runs a background daemon loop with independent intervals:
- Sync interval: Every 10 minutes (default) — indexes new sessions and extracts memories
- Maintain interval: Every 60 minutes (default) — merges duplicates, archives stale items
~/.lerim/config.toml:
Next steps
- Learn about native workflow for running without Docker
- Explore the dashboard interface
- Query memories with lerim ask