This is for beginners, by request. Advanced users just skip this.
Docker runs Sapphire in an isolated container — think of it as a lightweight virtual computer inside your computer. The container has its own operating system, Python, and all of Sapphire's dependencies pre-installed. Your data (chats, memories, settings) is stored on your real filesystem, not inside the container. When Sapphire updates, you delete the old container and create a new one — your data stays exactly where it is, untouched. Nothing critical lives inside the container. It's disposable by design.
Docker works in layers — the base system, Python packages, AI models, and Sapphire's code are stacked on top of each other. When you update, only the layers that changed get re-downloaded (usually just the code layer, which is tiny). The 700MB of AI models don't re-download every time.
- Can't break your system — Sapphire runs in its own sandbox. Bad plugins, shell commands gone wrong, experiments — they only affect the container, not your machine
- No dependency hell — No conda, no pip conflicts, no "works on my machine." Everything is pre-configured
- One command install — Pull and run. That's it
- Clean uninstall — Remove the container and your system is exactly how it was before
- Built-in command line — The container includes a full Linux environment with standard tools (curl, grep, git, etc.) that Sapphire's shell plugin can use safely
- Windows/Mac: Install Docker Desktop
- Linux: Install Docker Engine
mkdir ~/sapphire && cd ~/sapphire
curl -fsSL https://raw.githubusercontent.com/ddxfish/sapphire/main/docker-compose.yml -o docker-compose.yml
mkdir -p sapphire-data sapphire-backups sapphire-configmkdir $HOME\sapphire; cd $HOME\sapphire
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/ddxfish/sapphire/main/docker-compose.yml" -OutFile "docker-compose.yml"
mkdir sapphire-data, sapphire-backups, sapphire-configWindows note: Use PowerShell (not cmd.exe). Right-click Start → "Windows PowerShell" or search for "PowerShell."
Open docker-compose.yml in any text editor and set:
- Timezone — Change
America/New_Yorkto yours (timezone list) - API keys — Uncomment and fill in whichever LLM provider you use (Claude, OpenAI, etc.)
docker compose up -dGo to https://localhost:8073 in your browser and complete the setup wizard.
Note: You'll see a browser security warning about the self-signed certificate. This is normal — click "Advanced" → "Proceed" to continue.
Permissions note (Linux only): If you skipped step 2's
mkdircommands, Docker creates the data directories as root. Fix with:sudo chown -R $USER:$USER ~/sapphire
If you have an NVIDIA GPU and want faster voice processing:
- NVIDIA GPU drivers installed
- NVIDIA Container Toolkit installed
Edit docker-compose.yml and change the image line:
image: ghcr.io/ddxfish/sapphire:gpuAdd GPU access under the service:
services:
sapphire:
image: ghcr.io/ddxfish/sapphire:gpu
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]Then restart:
docker compose down
docker compose up -dKokoro TTS and Faster Whisper STT will automatically use the GPU. No settings changes needed.
| What you want | Command |
|---|---|
| Start Sapphire | docker compose up -d |
| Stop Sapphire | docker compose down |
| View logs | docker compose logs -f |
| Restart | docker compose restart |
When a new version is available:
docker compose down
docker compose pull
docker compose up -dThat's it. Your data in sapphire-data/, sapphire-backups/, and sapphire-config/ is untouched. Only the container (code + models) gets replaced.
docker compose down
docker rmi ghcr.io/ddxfish/sapphire:latestYour data stays in sapphire-data/, sapphire-backups/, and sapphire-config/.
docker compose down
docker rmi ghcr.io/ddxfish/sapphire:latestThen delete the data directories:
Linux / Mac:
rm -rf sapphire-data sapphire-backups sapphire-configWindows (PowerShell):
Remove-Item -Recurse -Force sapphire-data, sapphire-backups, sapphire-configEverything is stored in plain folders next to your docker-compose.yml:
sapphire/ ← ~/sapphire (Linux/Mac) or %USERPROFILE%\sapphire (Windows)
├── docker-compose.yml ← Configuration
├── sapphire-data/ ← Chats, memories, settings, plugins
│ ├── settings.json
│ ├── history/
│ ├── memory.db
│ ├── knowledge.db
│ └── ...
├── sapphire-backups/ ← Automatic backups
└── sapphire-config/ ← Credentials and secrets
These are normal folders on your machine. You can browse them, back them up, or move them to another computer.
If you run LM Studio on your host machine, Sapphire in Docker can connect to it.
Edit docker-compose.yml and uncomment the appropriate line:
# Docker Desktop (Mac/Windows):
LMSTUDIO_BASE_URL: "http://host.docker.internal:1234/v1"
# Linux Docker:
LMSTUDIO_BASE_URL: "http://172.17.0.1:1234/v1"Make sure LM Studio's server is running and set to allow network connections.
"Permission denied" on data directories (Linux)
mkdir -p sapphire-data sapphire-backups sapphire-configCreate the directories before first run so they're owned by your user, not root. If they already exist as root: sudo chown -R $USER:$USER sapphire-data sapphire-backups sapphire-config. This doesn't apply to Windows/Mac — Docker Desktop handles permissions automatically.
Browser shows "connection refused"
Sapphire takes 30-60 seconds to start on first run (loading AI models). Check progress with docker compose logs -f.
TTS occasionally fails The TTS engine has automatic retry with backoff. If a single message fails, regenerate it — subsequent attempts usually succeed immediately. This is more common on CPU than GPU.
Container keeps restarting
Check the logs for errors: docker compose logs --tail 50. Common causes:
- Missing API keys (configure in docker-compose.yml or via the web UI)
- Port 8073 already in use (change the port mapping in docker-compose.yml:
"8074:8073")