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+.
Background service (recommended)
Installs as an OS service: systemd on Linux, launchd on macOS, Task Scheduler on Windows. Starts automatically on boot.
pip install agentmetrics-server
agentmetrics install
Manage the service:
| Command | Description |
|---|---|
agentmetrics start | Start a stopped service |
agentmetrics stop | Stop without uninstalling |
agentmetrics restart | Restart |
agentmetrics status | Check state and health |
agentmetrics uninstall | Remove the service |
Custom port:
agentmetrics install --port 9000
PostgreSQL instead of SQLite:
agentmetrics install --db postgresql://user:pass@host/mydb
Foreground (quick test)
Runs in the terminal. Ctrl+C to stop.
pip install agentmetrics-server
agentmetrics-server
Custom port:
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.
git clone https://github.com/andalabx/agentmetrics
cd agentmetrics
docker compose up
Data is stored in a Docker volume and survives container restarts.
PostgreSQL
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
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
| Variable | Default | Description |
|---|---|---|
API_PORT | 8099 | API server port |
DASHBOARD_PORT | 3099 | Dashboard port |
DB_URL | SQLite | Database connection string |
SECRET_KEY | auto-generated | Session 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.