Deploy Context7 On-Premise with Docker Compose. This guide assumes you have completed the On-Premise setup and have a valid license key.
Prerequisites
- Docker and Docker Compose installed
- Context7 license key
Registry Authentication
Context7 Enterprise images are hosted on ghcr.io and require authentication. Log in using your license key:
LICENSE_KEY="<your-license-key>"
TOKEN=$(curl -s -H "Authorization: Bearer $LICENSE_KEY" \
https://context7.com/api/v1/license/registry-token | jq -r '.token')
docker login ghcr.io -u x-access-token -p $TOKEN
Docker stores these credentials locally. docker compose will use them automatically when pulling the image. You can also pull manually:
docker pull ghcr.io/context7/enterprise:latest
Docker Compose
Create a docker-compose.yml:
services:
context7:
image: ghcr.io/context7/enterprise:latest
container_name: context7
restart: unless-stopped
ports:
- "3000:3000"
volumes:
- context7-data:/data
environment:
- LICENSE_KEY=${LICENSE_KEY}
volumes:
context7-data:
driver: local
The context7-data volume is critical. It stores your SQLite database (configuration, credentials, indexed libraries) and all vector embeddings. Without a persistent volume, all data is lost when the container restarts or is recreated. Never run without a volume mount in production.
Create a .env file in the same directory:
Start the service:
Once the container is running, open http://localhost:3000 in your browser to complete the setup wizard.
Operations
Updating
If your registry login has expired, re-authenticate first:
LICENSE_KEY="<your-license-key>"
TOKEN=$(curl -s -H "Authorization: Bearer $LICENSE_KEY" \
https://context7.com/api/v1/license/registry-token | jq -r '.token')
docker login ghcr.io -u x-access-token -p $TOKEN
Then pull the latest image and restart the container:
docker compose pull
docker compose up -d
Data persists in the named Docker volume across updates.
Health Check
curl http://localhost:3000/api/health
Example response:
{
"status": "healthy",
"version": "1.0.0",
"setup": "complete",
"license": "configured",
"licenseInfo": {
"valid": true,
"teamSize": 10,
"expiresAt": "2026-06-01T00:00:00.000Z"
},
"repos_parsed": 5,
"uptime": 3600,
"connectivity": {
"llm": "configured",
"llm_provider": "openai",
"embedding": "configured",
"embedding_provider": "openai",
"github": "configured",
"gitlab": "not configured"
}
}
Connecting AI Clients
Once deployed, point your MCP clients to your deployment URL. See Connecting Your AI Client for client-specific instructions.