| layout | @/layouts/DocsLayout.astro |
|---|---|
| title | Docker |
| description | Run Basic Memory in Docker containers for server deployments and SSE transport |
import { Card, CardGroup, Info, Warning, Note, Tip, Steps, Step, CodeGroup, CodeTab } from '@/components'
The Docker image runs Basic Memory as an **SSE server** on port 8000. This is designed for server deployments where clients connect over HTTP, not for local MCP stdio connections with Claude Desktop.Basic Memory provides official Docker images published to GitHub Container Registry. The container runs the MCP server with SSE (Server-Sent Events) transport, suitable for:
- Server deployments where multiple clients connect remotely
- Kubernetes or Docker Compose orchestration
- CI/CD environments
- Development and testing
For local use with Claude Desktop or other MCP clients that use stdio transport, we recommend installing via Homebrew or pip.
docker pull ghcr.io/basicmachines-co/basic-memory:latestdocker run -d \
--name basic-container \
-p 8000:8000 \
-v ~/basic-memory-data:/app/data \
ghcr.io/basicmachines-co/basic-memory:latestThe server will be available at http://localhost:8000/mcp.
Images are published to GitHub Container Registry (GHCR):
ghcr.io/basicmachines-co/basic-memory
| Tag | Description |
|---|---|
latest |
Latest stable release |
0.17.5 |
Specific version |
0.17 |
Latest patch for minor version |
Multi-platform images are available for:
linux/amd64(Intel/AMD)linux/arm64(Apple Silicon, ARM servers)
Docker automatically pulls the correct architecture for your platform.
| Variable | Default | Description |
|---|---|---|
BASIC_MEMORY_HOME |
/app/data/basic-memory |
Path to Basic Memory data |
BASIC_MEMORY_PROJECT_ROOT |
/app/data |
Root directory for projects |
Mount a local directory to persist data:
docker run -d \
-v /path/to/local/data:/app/data \
-p 8000:8000 \
ghcr.io/basicmachines-co/basic-memory:latestThe container exposes port 8000 by default. Map to a different host port if needed:
docker run -d \
-p 3000:8000 \
ghcr.io/basicmachines-co/basic-memory:latestFor more complex setups, use Docker Compose:
version: '3.8'
services:
basic-container:
image: ghcr.io/basicmachines-co/basic-memory:latest
container_name: basic-container
ports:
- "8000:8000"
volumes:
- ./data:/app/data
environment:
- BASIC_MEMORY_HOME=/app/data/basic-memory
restart: unless-stopped
healthcheck:
test: ["CMD", "basic-memory", "--version"]
interval: 30s
timeout: 10s
retries: 3Run with:
docker compose up -dConfigure your MCP client to connect via SSE transport:
{
"mcpServers": {
"basic-memory": {
"transport": {
"type": "sse",
"url": "http://localhost:8000/mcp"
}
}
}
}Verify the server is running:
curl http://localhost:8000/healthOr check container health:
docker inspect --format='{{.State.Health.Status}}' basic-containerYou can run Basic Memory CLI commands inside the container. Note that the first argument is the container name (basic-container) and the second is the CLI command (basic-memory):
# Check version
docker exec basic-container basic-memory --version
# Check status
docker exec basic-container basic-memory status
# List projects
docker exec basic-container basic-memory project listThe container runs as a non-root user (appuser) for security. Key security features:
- Non-root execution (UID/GID 1000 by default)
- No unnecessary packages installed
- Health checks enabled
- Slim base image (Python 3.12 slim-bookworm)
Build with custom user IDs for permission compatibility:
docker build --build-arg UID=1001 --build-arg GID=1001 -t basic-memory:custom .If you see permission errors with mounted volumes:
# Fix ownership on host
sudo chown -R 1000:1000 /path/to/local/data
# Or run with matching UID
docker run --user $(id -u):$(id -g) ...Check the logs:
docker logs basic-containerCommon causes:
- Port 8000 already in use
- Volume mount path doesn't exist
- Insufficient permissions
For Claude Desktop integration, either:
- Install Basic Memory locally via Homebrew or pip
- Use the SSE transport configuration (if your Claude Desktop version supports it)
Clone the repository and build locally:
git clone https://github.com/basicmachines-co/basic-memory.git
cd basic-memory
docker build -t basic-memory:local .- Getting Started - Local installation options
- CLI Reference - Command line interface
- MCP Tools Reference - Available MCP tools