Astervis Docs

Environment Variables

Configure Astervis via environment variables

All configuration is stored in /opt/astervis/.env. Changes require service restart.

Database Settings

VariableDefaultDescription
POSTGRES_USERastervisPostgreSQL username
POSTGRES_PASSWORD[generated]PostgreSQL password
POSTGRES_HOSTtimescaledbDatabase hostname
POSTGRES_PORT5432Database port
POSTGRES_DBastervisDatabase name

Don't change database credentials after installation unless you also update the database users.

Redis Settings

VariableDefaultDescription
REDIS_HOSTredisRedis hostname
REDIS_PORT6379Redis port

Server Settings

VariableDefaultDescription
SERVER_IP[your IP/domain]Server address for SSL and URLs
BACKEND_PORT5555Backend API port
PORT6464Frontend port

Authentication

VariableDefaultDescription
BETTER_AUTH_SECRET[generated]Session encryption key (32 chars)
BETTER_AUTH_URLhttps://[SERVER_IP]:8443Public URL for auth
SESSION_EXPIRES_IN86400Session timeout (seconds)
REFRESH_TOKEN_EXPIRES_IN432000Refresh token timeout (seconds)

MySQL (PBX) Settings

VariableDefaultDescription
MYSQL_HOSThost.docker.internalPBX MySQL host
MYSQL_PORT3306MySQL port
MYSQL_USER[auto-detected]MySQL username
MYSQL_PASSWORD[auto-detected]MySQL password
MYSQL_DBasteriskcdrdbCDR database name
MYSQL_USERS_DBasteriskAsterisk users database
MYSQL_TIMEZONE[server timezone]PBX server timezone

See MySQL Configuration for details.

Timezone

VariableDefaultDescription
TIMEZONEAsia/TashkentApplication timezone
NEXT_PUBLIC_TIMEZONEAsia/TashkentFrontend display timezone
MYSQL_TIMEZONEAsia/TashkentPBX server timezone

See Timezone Configuration for details.

License

VariableDescription
LICENSE_KEYYour Astervis license key
COMPANY_NAMECompany name (from license)

Agent Communication

VariableDefaultDescription
ASTERVIS_AGENT_API_KEY[generated]API key for agent
ASTERVIS_AGENT_API_URLhttp://host.docker.internal:9876Agent URL

Performance Tuning

VariableDefaultDescription
HTTP_TIMEOUT30000HTTP request timeout (ms)
HTTP_MAX_RETRIES3Max HTTP retries
NODE_OPTIONS--max-old-space-size=3072Node.js heap size

Editing Configuration

# Edit environment file
sudo nano /opt/astervis/.env
 
# Apply changes
cd /opt/astervis
docker compose down && docker compose up -d

Example .env File

# Database
POSTGRES_USER=astervis
POSTGRES_PASSWORD=xY7kL9mN2pQ4rS6t
POSTGRES_HOST=timescaledb
POSTGRES_PORT=5432
POSTGRES_DB=astervis

# Redis
REDIS_HOST=redis
REDIS_PORT=6379

# Server
SERVER_IP=pbx.company.com
BACKEND_PORT=5555
PORT=6464

# Auth
BETTER_AUTH_SECRET=aB3cD4eF5gH6iJ7kL8mN9oP0qR1sT2uV
BETTER_AUTH_URL=https://pbx.company.com:8443
SESSION_EXPIRES_IN=86400

# MySQL (PBX)
MYSQL_HOST=host.docker.internal
MYSQL_PORT=3306
MYSQL_USER=freepbxuser
MYSQL_PASSWORD=your_password
MYSQL_DB=asteriskcdrdb
MYSQL_TIMEZONE=Europe/Moscow

# Timezone
TIMEZONE=Europe/Moscow
NEXT_PUBLIC_TIMEZONE=Europe/Moscow

# License
LICENSE_KEY=ast-xxxx...
COMPANY_NAME=Your Company

On this page