Self-hosting

AgentLens runs as a single Node service against a MySQL database. Nothing calls out to us — the collector talks to your install and stops there.

What it needs

  • Node 20.9 or newer.
  • MySQL 8.4 (or Percona Server 8.4). One database, owned by one user.
  • A TLS-terminating reverse proxy in front of the app. The service itself binds to loopback.

Two vCPUs and 4 GB of RAM comfortably run the app and the database together for a team-sized workspace.

Configuration

Three environment variables. The app validates them at boot and fails with a readable message rather than surfacing a connection error later.

DATABASE_URL="mysql://user:password@127.0.0.1:3306/agentlens"
BETTER_AUTH_SECRET="$(openssl rand -base64 32)"
BETTER_AUTH_URL="https://agentlens.internal.example.com"

BETTER_AUTH_URL must be the public origin users reach — session cookies are issued against it. Keep the env file at mode 600.

Database schema

Migrations are versioned and applied before the app starts. They are idempotent: re-running applies only what's outstanding.

npm ci
npm run db:migrate
npm run build
npm run start

Run db:migrate again on every upgrade, before starting the new build.

Pointing collectors at it

The collector defaults to the cloud, so self-hosted installs pass the URL explicitly — once at connect time, or via the environment:

npx @sinaispace/agentlens connect \
  --token al_... \
  --url https://agentlens.internal.example.com

# or, for everyone on a machine
export AGENTLENS_URL="https://agentlens.internal.example.com"

The collector is MIT licensed, so you can vendor it, audit it or build it yourself. The CLI reference applies unchanged.

Backups

Everything durable is in MySQL — the app holds no state on disk beyond its build output. A standard logical dump is a complete backup:

mysqldump --single-transaction agentlens | gzip > agentlens.sql.gz

Getting the server build

The collector is public. The server itself ships with Enterprise, which is also where SAML, SCIM, audit logs and data residency live — talk to us and we'll get you a build and a licence.