Skip to content

Single Server

The simplest deployment: everything on one server.

Terminal window
# Clone the repo (early-access only — see note above)
cd /opt/modelreins
# Create a virtualenv and install dependencies
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
# Copy and edit the config
cp .env.example .env
# Edit .env — set DATABASE_URL, SECRET_KEY, and provider API keys
Terminal window
cd /opt/modelreins
source .venv/bin/activate
python -m modelreins.server --port 7420

Create /etc/systemd/system/modelreins.service:

[Unit]
Description=ModelReins Coordinator
After=network.target postgresql.service
[Service]
WorkingDirectory=/opt/modelreins
ExecStart=/opt/modelreins/.venv/bin/python -m modelreins.server --port 7420
EnvironmentFile=/opt/modelreins/.env
Restart=on-failure
User=modelreins
[Install]
WantedBy=multi-user.target

Then enable it:

Terminal window
sudo systemctl daemon-reload
sudo systemctl enable --now modelreins

Install the Companion app on the same host and point it at http://localhost:7420. See Add a Worker for details.

Put the dashboard behind nginx with HTTPS:

server {
listen 443 ssl;
server_name modelreins.example.com;
ssl_certificate /etc/ssl/certs/modelreins.pem;
ssl_certificate_key /etc/ssl/private/modelreins.key;
location / {
proxy_pass http://localhost:7420;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
}
}
Terminal window
curl http://localhost:7420/health

Should return 200 OK. Then open http://your-server:7420 in a browser to reach the dashboard.