GoLiveKit

Environment Variables

A complete reference of all environment variables used in GoLiveKit.

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.

[!IMPORTANT] 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.

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. no-reply@example.com.

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.

On this page