Skip to main content

Self-Hosting Guide

OpRelay is designed to be self-hosted. SQLite is the default — no database setup required.

Local (fastest)

git clone git@github.com:oprelay/oprelay.git && cd oprelay
cd server
cp .env.example .env
npm install
npm run build
npm start # http://localhost:3100

The server creates a local SQLite database automatically.

Docker Compose

git clone git@github.com:oprelay/oprelay.git && cd oprelay
cp docker-compose.core.env.example .env
docker compose -f docker-compose.core.yml up -d

Dashboard at http://localhost:3100.

Bare metal (systemd)

[Unit]
Description=OpRelay MCP Server
After=network.target

[Service]
Type=simple
User=oprelay
WorkingDirectory=/opt/oprelay/server
ExecStart=/usr/bin/node dist/src/index.js
Restart=always
EnvironmentFile=/opt/oprelay/server/.env

[Install]
WantedBy=multi-user.target

Reverse proxy

If running behind nginx:

server {
listen 443 ssl;
server_name oprelay.example.com;

location / {
proxy_pass http://127.0.0.1:3100;

# Required for MCP StreamableHTTP
proxy_buffering off;
proxy_cache off;
proxy_read_timeout 300s;
proxy_send_timeout 300s;
proxy_http_version 1.1;
chunked_transfer_encoding on;
}
}

Key settings for MCP:

  • proxy_buffering off — SSE responses must not be buffered
  • proxy_read_timeout 300s — long-lived MCP sessions
  • chunked_transfer_encoding on — streaming support

Storage

SQLite is the default and works out of the box. The server creates oprelay.db automatically — no configuration needed.

Set DATABASE_TYPE=sqlite in your .env (or simply omit any database credentials).