Deploy

AgentMetrics is self-hosted. No account, no external service — your data stays on your infrastructure.

Two components run together:

  • API server (port 8099): receives agent events and stores them
  • Dashboard (port 3099): displays your run data

Both need to be running before SDK calls go anywhere.

pip install

No Docker required. The simplest way to get started.

Requires Python 3.11+.

Installs as an OS service: systemd on Linux, launchd on macOS, Task Scheduler on Windows. Starts automatically on boot.

Shell
pip install agentmetrics-server
agentmetrics install

Manage the service:

CommandDescription
agentmetrics startStart a stopped service
agentmetrics stopStop without uninstalling
agentmetrics restartRestart
agentmetrics statusCheck state and health
agentmetrics uninstallRemove the service

Custom port:

Shell
agentmetrics install --port 9000

PostgreSQL instead of SQLite:

Shell
agentmetrics install --db postgresql://user:pass@host/mydb

Foreground (quick test)

Runs in the terminal. Ctrl+C to stop.

Shell
pip install agentmetrics-server
agentmetrics-server

Custom port:

Shell
agentmetrics-server --port 9000

Docker Compose

Runs both the API and dashboard together. Good for teams running everything in containers.

Requires Docker with the Compose plugin.

Shell
git clone https://github.com/andalabx/agentmetrics
cd agentmetrics
docker compose up

Data is stored in a Docker volume and survives container restarts.

PostgreSQL

Shell
docker compose --profile postgres up

Cloud deployment

Deploy once, have your whole team point their SDKs at the same server.

The repository includes ready-to-use configs for three platforms.

Warning

SQLite files don't persist across restarts on most PaaS platforms. Use PostgreSQL for all cloud deployments.

Render

Connect the repo in Render — render.yaml is picked up automatically. Set DB_URL to a PostgreSQL connection string in the Render environment settings.

Fly.io

Shell
fly launch --config fly.toml
fly secrets set DB_URL=postgresql://...

Railway

Connect the repo in Railway and set your environment variables. No config file needed.

Environment variables

VariableDefaultDescription
API_PORT8099API server port
DASHBOARD_PORT3099Dashboard port
DB_URLSQLiteDatabase connection string
SECRET_KEYauto-generatedSession signing key: set a stable value in production

Get an API key

Once the server is running, open the dashboard at http://localhost:3099 and go to Settings to generate a key.

Running locally for development? Any non-empty string works as the key.