Skip to main content

Self-Hosting Memanto Server

memanto serve runs the same FastAPI server that powers the REST API. For development, running it from the CLI is enough — but for shared environments you’ll want it under a process manager that survives logouts and restarts. This page covers Docker, Docker Compose, systemd, and a manual long-running process. All four options work for both backends — set MEMANTO_BACKEND=on-prem to talk to your local Moorcheh server, or leave it cloud (default) for Moorcheh Cloud.

Image: What Memanto Ships

The Memanto repository includes a production-ready Dockerfile:
  • Base: python:3.12-slim
  • Runs as a non-root user (memanto, UID 1001)
  • Exposes port 8000
  • Builds dependencies via uv for fast, deterministic installs
  • Built-in HEALTHCHECK polling /ready (a lightweight endpoint that does not call Moorcheh)
  • Entry point: uvicorn memanto.app.main:app --host 0.0.0.0 --port 8000

Option 1: Docker

Cloud backend

Expected response:

On-prem backend

Memanto’s container needs to reach the Moorcheh on-prem container running on the same host. On Linux/macOS, use host.docker.internal; on Linux without Docker Desktop, use --network host instead.
Or, if Moorcheh and Memanto are on the same user-defined Docker network (recommended):

Option 2: Docker Compose

The Memanto repo ships a docker-compose.yml for the cloud backend. Drop in an .env file and you’re done.

Cloud backend

On-prem backend

Extend the compose file to add the Moorcheh server and (optionally) Ollama:
Bring it up:

Option 3: systemd (Linux)

For a single-host install without Docker, run Memanto under systemd. Save as /etc/systemd/system/memanto.service:
Then:
The on-prem Moorcheh container (moorcheh up) should be managed by a separate systemd unit or by Docker’s own --restart unless-stopped so it comes back automatically.

Option 4: Manual / Background

For one-off testing on a remote host:
Stop it with pkill -f "memanto serve". Not recommended for production — use systemd or Docker.

Endpoints to Probe

All deployment modes expose the same operational endpoints:

Performance & Concurrency

For more than a handful of concurrent agents, run Memanto with multiple uvicorn workers behind a reverse proxy:
Recommended starting point for a single host:
  • 2 workers per CPU core (Memanto is I/O-bound).
  • Reverse proxy (Nginx, Caddy, or Traefik) terminating TLS and forwarding to 127.0.0.1:8000.
  • Rate limits at the proxy if exposing publicly.

CORS

By default, ALLOWED_ORIGINS=*. Restrict in production:

Logs

Structured JSON logging is enabled by default. Memory operations are logged with content redaction so payloads never end up in your log aggregator.
Set LOG_LEVEL=DEBUG for detailed request/response traces during troubleshooting.

Next Steps