Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Excurs1ons/MonoRelay/llms.txt

Use this file to discover all available pages before exploring further.

MonoRelay supports five deployment methods. Docker is the recommended choice for most production environments because it handles dependencies, isolation, and data persistence automatically. If you prefer to run MonoRelay directly on the host, systemd and PM2 both provide automatic restart and log management.
Docker is the fastest path to a production-ready deployment. The official image is built on python:3.12-slim and exposes port 8787.1. Copy and edit the configuration file
cp config.yml.example config.yml
# Edit config.yml — set access_key and add your provider API keys
2. Start the container
docker compose up -d
3. Verify the container is healthy
docker compose ps
docker compose logs -f monorelay
Common commands
# Stop the service
docker compose down

# Restart after a config change
docker compose restart monorelay

# Rebuild the image after a code update
docker compose build && docker compose up -d
Environment variablesThe docker-compose.yml passes the following environment variables to the container. You can override them in a .env file or directly in docker-compose.yml.
VariableDescriptionDefault
TZContainer timezoneAsia/Shanghai
Data persistenceDocker Compose creates a named volume (monorelay-data) mounted at /app/data. The following files are persisted across container restarts and upgrades:
FileContents
data/users.dbUser accounts and roles
data/requests.dbFull request and response log
data/stats.jsonAggregated request statistics
data/config.ymlRuntime configuration (written by the in-browser config editor)
Your config.yml on the host is mounted read-only at /app/config.yml. Edits made through the admin dashboard’s config editor are written to the persistent volume at /app/data/config.yml and take precedence.

Port reference

PortService
8787MonoRelay API and admin dashboard

Data persistence

Regardless of the deployment method, MonoRelay writes its runtime data to the ./data/ directory (relative to the working directory where the server was started). All files in this directory should be backed up if you need to preserve logs and user accounts across reinstalls.
PathContents
data/users.dbUser accounts, roles, and OAuth identities
data/requests.dbSQLite log of every request and response
data/stats.jsonAggregated usage statistics
data/config.ymlConfig written by the in-browser editor (overrides config.yml)
The data/ directory is excluded from version control (.gitignore). Do not delete it while the server is running.

Nginx reverse proxy

To serve MonoRelay over HTTPS or on a standard port, place Nginx in front of it. The following configuration proxies all traffic to MonoRelay on port 8787 and adds SSE-specific settings for the log stream endpoint.
server {
    listen 443 ssl;
    server_name your-domain.com;

    ssl_certificate     /path/to/fullchain.cer;
    ssl_certificate_key /path/to/your-domain.key;

    # SSE log stream — disable buffering
    location /api/logs/stream {
        proxy_pass http://127.0.0.1:8787;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;

        proxy_http_version 1.1;
        proxy_set_header Connection "";
        proxy_buffering off;
        proxy_cache off;
        chunked_transfer_encoding on;
        tcp_nopush on;
        tcp_nodelay on;
        keepalive_timeout 300;
    }

    # All other routes
    location / {
        proxy_pass http://127.0.0.1:8787;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

# Redirect HTTP to HTTPS
server {
    listen 80;
    server_name your-domain.com;
    return 301 https://$host$request_uri;
}
After adding the Nginx config, set public_host in config.yml so MonoRelay generates correct API URLs in the admin dashboard:
config.yml
server:
  public_host: "https://your-domain.com"

Build docs developers (and LLMs) love