Docs refreshed for Astervis v1 — now covering AI call analytics. What’s new
Astervis Docsv1.0
Configuration

Environment Variables

The .env reference for a running Astervis install.

Every setting for a running Astervis install lives in a single file: /opt/astervis/.env. The installer generates it for you during setup — random passwords and secrets included — so on a fresh install you usually never touch it. This page is for the times you do: when you need to understand what a value means, point Astervis at a different MariaDB, or rotate a secret.

The file is owned by root and written with mode 0600 (only root can read it). It's read by Docker Compose, which injects the values into the containers, so changes only take effect after you restart the stack.

Astervis is on-premise only. Everything in this file — database, Redis, the PBX connection, recordings — stays on your server. The one variable that points off-server is AI_GATEWAY_URL, and only if you've enabled the optional AI features. See AI & Privacy.

Editing and applying changes

Edit the file as root

sudo nano /opt/astervis/.env

Restart the stack to apply

cd /opt/astervis
docker compose up -d

Compose recreates only the containers whose environment actually changed. For a full bounce, use docker compose down && docker compose up -d, or the installer's wrapper: sudo astervis-installer restart.

Some values are baked in on first run and cannot be changed by editing .env alone. The most important is POSTGRES_PASSWORD: PostgreSQL only applies it when the data directory is first initialised, so editing it later won't change the role's real password and migrate will fail to authenticate. If you must rotate the DB password, reset the role inside the database too — don't just edit the file.

PostgreSQL / TimescaleDB

The primary data store. A single TimescaleDB-HA image (PostgreSQL 16 with the TimescaleDB and pgvector extensions) holds your CDR analytics, AI transcripts, and vector embeddings. It binds to 127.0.0.1:5432 on the host and is never exposed externally.

VariableDefaultDescription
POSTGRES_USERastervisDatabase role used by the backend and queue.
POSTGRES_PASSWORDgenerated (24 chars)Role password. Set on first init only — see the warning above.
POSTGRES_HOSTtimescaledbCompose service name. Containers resolve it on the internal network.
POSTGRES_PORT5432PostgreSQL port (host-published on 127.0.0.1).
POSTGRES_DBastervisDatabase name.

Redis

Used for Better Auth session caching and the BullMQ job queue that drives the AI pipeline. Binds to 127.0.0.1:6380 on the host (mapped from the container's 6379).

VariableDefaultDescription
REDIS_HOSTredisCompose service name.
REDIS_PORT6379In-container Redis port.

Backend and frontend ports

These are in-container ports. Only nginx is reachable from outside the host — on port 8443 — so changing these values won't expose anything new; they coordinate the reverse proxy with the apps behind it.

VariableDefaultDescription
BACKEND_PORT5555Elysia.js backend API port (container astervis-app).
PORT6464Next.js admin UI port (container astervis-nextjs).
HOST_URLyour domain or IPPublic base URL Astervis advertises to clients.
BACKEND_TRPC_API_URLhttp://app:5555Internal URL the admin uses to reach the backend.

The product UI is always served at https://<your-domain-or-IP>:8443. That 8443 is the only port the installer opens to the network — every other service binds to loopback.

Authentication (Better Auth)

Astervis uses Better Auth with Redis-cached sessions and JWTs for API calls. The secret is generated for you; the URL must match the address users actually visit, including the :8443 port.

VariableDefaultDescription
BETTER_AUTH_SECRETgenerated (32 chars)Signs and encrypts sessions. Rotating it logs everyone out.
BETTER_AUTH_URLhttps://<domain-or-IP>:8443Public auth base URL. Must match the address in the browser.
NEXT_PUBLIC_TIMEZONEAsia/TashkentTimezone the admin UI renders timestamps in. The DB always stores UTC.

MySQL / PBX

How Astervis reaches your PBX's MariaDB to read Call Detail Records and operator data. The installer auto-detects these from FreePBX where it can.

VariableDefaultDescription
MYSQL_HOSThost.docker.internalSee the rewrite note below.
MYSQL_PORT3306MariaDB port.
MYSQL_USERauto-detectedCDR DB user (e.g. freepbxuser). Also used by the CDC service.
MYSQL_PASSWORDauto-detectedPassword for the above.
MYSQL_DBasteriskcdrdbCDR database.
MYSQL_USERS_DBasteriskAsterisk config DB (operators, queues).
MYSQL_TIMEZONEserver timezoneHow the PBX stores calldate, so Astervis can normalise it.

MYSQL_HOST is rewritten on purpose. Your MariaDB usually listens on the host, not inside a container — so a value like localhost or 127.0.0.1 would point a container at its own loopback, where nothing is listening. The installer rewrites any loopback value (localhost, 127.0.0.1, ::1, 0.0.0.0) to host.docker.internal so containers reach the host's MariaDB. A real LAN or remote IP is left untouched. If you move the database, set this to the new reachable address — not localhost.

ARI (Asterisk REST Interface)

The backend connects to Asterisk's REST interface for live call control — for example, the blacklist fallback that hangs up a blocked caller on ChannelCreated.

VariableDefaultDescription
ARI_HOSThost.docker.internalReaches Asterisk's HTTP server on the host.
ARI_PORT8088Asterisk ARI/HTTP port.
ARI_LOGINconfigured at installARI username.
ARI_PASSWORDconfigured at installARI password.
ARI_TC_DEVICEauto-detectedFreePBX Time Condition device used to detect after-hours calls.

AMI (blacklist sync)

The phone blacklist keeps Asterisk's astdb in sync over the Asterisk Manager Interface, so blocked numbers are rejected at the PBX itself.

VariableDefaultDescription
AMI_HOSThost.docker.internalReaches the AMI listener on the host.
AMI_PORT5038Asterisk Manager Interface port.
AMI_LOGINconfigured at installAMI username.
AMI_PASSWORDconfigured at installAMI password.

Recording access

Call recordings are mounted read-only from the PBX into the backend and queue containers. The signing secret protects recording download URLs so they can't be guessed or shared without authorisation.

VariableDefaultDescription
RECORDING_SIGN_SECRETgenerated (32 chars)HMAC secret that signs time-limited recording URLs.

The recordings themselves aren't an env var — they're a bind mount. The installer mounts the host's monitor directory into the containers:

volumes:
  - /var/spool/asterisk/monitor:/records

Inside the containers, recordings appear under /records. If your PBX stores recordings elsewhere, adjust the host side of that mount in docker-compose.yml.

AI

Optional. These point the stack at the central AI Gateway, which runs transcription and QA analysis on Google Gemini (Vertex AI). If your license doesn't include AI, these are harmless and unused.

VariableDefaultDescription
AI_GATEWAY_URLhttps://ai-gateway.astervis.ioWhere the backend verifies the AI license and submits audio for analysis.
BACKEND_URLyour backend URLWhere the gateway posts webhook callbacks with finished results.

AI_GATEWAY_URL is the only outbound endpoint in this file. When AI is on, the audio of a finished call is sent there for analysis — nothing else leaves the server. See AI & Privacy for the full picture.

Astervis Agent

The installer also runs as a small REST API agent (astervis-agent) on the host, port 9876. The product uses it to check for updates, validate the license, and renew certs. Because the agent lives on the host, the backend reaches it via host.docker.internal.

VariableDefaultDescription
ASTERVIS_AGENT_API_KEYgenerated (32 chars)Sent as X-API-Key to authenticate to the agent.
ASTERVIS_AGENT_API_URLhttp://host.docker.internal:9876Where the backend reaches the agent.

CDC / replication (litcdc)

Astervis replicates every CDR out of the PBX's MariaDB binlog using litcdc, a tiny Rust service that takes a one-time snapshot of the cdr table and then streams changes in realtime to TimescaleDB. (litcdc replaced the old Debezium + Redpanda pipeline; it's a single ~10–25 MiB process.) Most of its tuning lives in docker-compose.yml, but one knob surfaces in .env:

VariableDefaultDescription
REPLICATION_THROTTLE_MS0Delay between replication batches, in milliseconds. 0 = drain at full speed.

Keep REPLICATION_THROTTLE_MS=0 unless you have a specific reason to slow replication. Zero throttle drains the litcdc buffer fast — roughly 150 events/sec, clearing a 64k-row historical backfill in about 8 minutes — and keeps the durable buffer shallow.

Runtime and paths

VariableDefaultDescription
DATA_DIR/opt/astervisBase directory for host-mounted data (DB, Redis, litcdc buffer, uploads, SSL).
NODE_ENVproductionNode runtime mode. Leave as production.
NODE_OPTIONS--max-old-space-size=3072Node.js heap cap (MB). Raise only on a memory-rich host running into OOM.

A minimal example

A trimmed .env showing the shape of the file. The real one the installer writes has more entries and real generated secrets — this uses placeholders, never copy these values.

# PostgreSQL / TimescaleDB
POSTGRES_USER=astervis
POSTGRES_PASSWORD=replace-with-generated-secret
POSTGRES_HOST=timescaledb
POSTGRES_PORT=5432
POSTGRES_DB=astervis

# Redis
REDIS_HOST=redis
REDIS_PORT=6379

# Backend / frontend
BACKEND_PORT=5555
PORT=6464
HOST_URL=https://pbx.example.com:8443
BACKEND_TRPC_API_URL=http://app:5555

# Auth (Better Auth)
BETTER_AUTH_SECRET=replace-with-generated-secret
BETTER_AUTH_URL=https://pbx.example.com:8443
NEXT_PUBLIC_TIMEZONE=Asia/Tashkent

# MySQL / PBX (host rewritten to host.docker.internal)
MYSQL_HOST=host.docker.internal
MYSQL_PORT=3306
MYSQL_USER=freepbxuser
MYSQL_PASSWORD=replace-with-pbx-db-password
MYSQL_DB=asteriskcdrdb
MYSQL_USERS_DB=asterisk
MYSQL_TIMEZONE=Asia/Tashkent

# ARI
ARI_HOST=host.docker.internal
ARI_PORT=8088
ARI_LOGIN=astervis
ARI_PASSWORD=replace-with-ari-password

# AMI (blacklist)
AMI_HOST=host.docker.internal
AMI_PORT=5038
AMI_LOGIN=astervis
AMI_PASSWORD=replace-with-ami-password

# Recording
RECORDING_SIGN_SECRET=replace-with-generated-secret

# AI (optional)
AI_GATEWAY_URL=https://ai-gateway.astervis.io
BACKEND_URL=https://pbx.example.com:8443

# Agent
ASTERVIS_AGENT_API_KEY=replace-with-generated-secret
ASTERVIS_AGENT_API_URL=http://host.docker.internal:9876

# CDC / replication
REPLICATION_THROTTLE_MS=0

# Runtime
DATA_DIR=/opt/astervis
NODE_ENV=production
NODE_OPTIONS=--max-old-space-size=3072

Never commit, paste, or share /opt/astervis/.env. It contains your database password, the Better Auth secret, your PBX MariaDB credentials, ARI/AMI passwords, the recording-signing secret, and the agent API key. Anyone with this file can read your call data and impersonate the stack. Keep it on the server, mode 0600, root-only. If a secret is exposed, rotate it and restart the affected services.

Last updated on

On this page