Documentation

Environment Variables

A complete reference of all environment variables used in GoLiveKit.

AI Skill for environment-variables

Prompt: Type /environment-variables in your Copilot / Cursor or other chat to use skill with the provided context.
/environment-variables Add the [VARIABLE_NAME] environment variable.

Security Notice

For security reasons, the AI agent does not have access to read or write your .env files. The agent will update the type-safe configuration in src/config/env.ts and .env.example, but you must manually add the actual secrets to your local .env and .env.local files.

Copy .env.example to .env and fill in the values before starting the app:

cp .env.example .env

Application

VariableDescription
NODE_ENVRuntime environment. Use development locally and production for deployments.
NEXT_PUBLIC_BASE_HOSTThe public base URL of the app, e.g. http://localhost:3000. Used to build absolute URLs.

Database

The database connection is built from the individual DB_* variables. No separate DATABASE_URL is required.

Docker Compose DB Host

If your app and Postgres run in Docker Compose, set DB_HOST to the Postgres service name (usually postgres), not localhost. Inside containers, localhost points to the same container and causes Prisma P1001 errors. For internal Docker network connections without Postgres TLS enabled, use DB_SSLMODE=disable.

VariableDescription
DB_USERPostgreSQL username.
DB_PASSPostgreSQL password.
DB_HOSTDatabase host. Use localhost for a host-local database, or the Postgres service name (e.g. postgres) when both app and DB run in Docker Compose.
DB_PORTDatabase port. Defaults to 5432.
DB_NAMEName of the PostgreSQL database.
DB_SSLMODESSL mode for the connection. Use disable for internal Docker network DB connections without TLS, and require only when your Postgres endpoint is configured for TLS. Accepted values: disable, require, prefer, allow, verify-full, verify-ca.

Authentication

GoLiveKit uses Better Auth for authentication.

VariableDescription
BETTER_AUTH_URLThe full URL of your app, used by Better Auth for callbacks. Should match NEXT_PUBLIC_BASE_HOST.
BETTER_AUTH_SECRETA random secret used to sign auth tokens. Generate one with openssl rand -hex 32.
GOOGLE_CLIENT_IDOAuth client ID from Google Cloud Console. Required for Google sign-in.
GOOGLE_CLIENT_SECRETOAuth client secret from Google Cloud Console. Required for Google sign-in.
ADMIN_EMAILAdmin email address.
ADMIN_PASSWORDPassword, minimum 8 symbols.
ADMIN_NAMEAdmin name.

Email

Used for transactional emails (magic links, welcome emails, etc.). Any SMTP provider works.

VariableDescription
EMAIL_SERVER_USERSMTP username / login for your email provider.
EMAIL_SERVER_PASSWORDSMTP password for your email provider.
EMAIL_SERVER_HOSTSMTP host, e.g. smtp.resend.com or smtp.gmail.com.
EMAIL_SERVER_PORTSMTP port, typically 465 (SSL) or 587 (STARTTLS).
EMAIL_FROMThe sender address shown to recipients, e.g. [email protected].

Storage (S3)

File uploads are stored in an S3-compatible bucket. Works with AWS S3, Cloudflare R2, MinIO, and others.

VariableDescription
S3_REGIONAWS region or equivalent, e.g. eu-central-1.
S3_BUCKETName of your S3 bucket.
S3_ACCESS_KEY_IDAccess key ID for your S3-compatible provider.
S3_SECRET_ACCESS_KEYSecret access key for your S3-compatible provider.
S3_ENDPOINT(Optional) Custom endpoint URL for S3-compatible providers (e.g. Cloudflare R2, MinIO). Leave unset for AWS S3.
S3_PUBLIC_BASE_URL(Optional) Public base URL for accessing uploaded files, e.g. a CloudFront distribution or R2 public URL.

Analytics

VariableDescription
NEXT_PUBLIC_GOOGLE_ANALYTICS_ID(Optional) Google Analytics 4 measurement ID, e.g. G-XXXXXXXXXX. Find it in your GA4 property settings. Leave unset to disable analytics.

Notifications (Telegram)

Telegram notifications are optional. If variables are missing, notification sending is skipped.

VariableDescription
TELEGRAM_BOT_TOKEN(Optional) Bot token created via @BotFather.
TELEGRAM_CHANNEL_ID(Optional) Telegram group/channel ID without the leading - (example: 1001234567890).

On this page