Self-Hosting
Self-host mem/ctl on your own infrastructure
Self-Hosting
mem/ctl is open source (Apache-2.0) and can be self-hosted.
For local setup and day-to-day development, see Local Development. For production planning, see Deployment.
Requirements
- Node.js 20+
- A Turso database (or any libSQL-compatible database)
- GitHub OAuth app (for authentication)
- Stripe account (for billing, optional)
Setup
1. Clone and install
git clone https://github.com/memctl/memctl.git
cd memctl
pnpm install2. Configure environment
cp .env.example .envFill in the required values in .env.
3. Set up database
pnpm db:push4. Build and start
pnpm build
pnpm start5. Configure your agents
Point your MCP server to your self-hosted instance using memctl auth or environment variables:
MEMCTL_API_URL=https://your-instance.com/api/v1 npx memctl authOr add MEMCTL_API_URL to your MCP config:
{
"mcpServers": {
"memctl": {
"command": "npx",
"args": ["-y", "memctl@latest"],
"env": {
"MEMCTL_API_URL": "https://your-instance.com/api/v1",
"MEMCTL_ORG": "your-org",
"MEMCTL_PROJECT": "your-project"
}
}
}
}Docker
Quick start (development)
cp .env.example .env
docker compose up
docker compose exec web pnpm db:pushThis starts a local libSQL database on port 8080 and the web app on port 3000 with hot reload.
Production build
docker build --build-arg NEXT_PUBLIC_APP_URL=https://your-domain.com -t memctl-web .The production image runs a standalone Next.js server as a non-root user on port 3000. See Local Development for the full Docker Compose setup and configuration details.