Skip to content

Environment Variables

Mehmet Celik edited this page Jul 17, 2025 · 5 revisions

The .env file is used to configure the application. Below is a detailed explanation of the environment variables required for the application to function properly.

The .env.example file contains a complete list of variables to help you set up your environment. You can download and rename it as .env.

All variables must be provided unless explicitly marked as optional.

Site Configuration

SITE_URL

  • Description: The base URL of your site.
  • Default: http://localhost:3000
  • Usage: Set this to your domain URL without a trailing slash. Examples:
    • SITE_URL=https://www.yourdomain.com
    • SITE_URL=http://192.168.1.100
    • SITE_URL=http://test.local:3000 (with port numbers if applicable)

Database Configuration

POSTGRES_DB

  • Description: The name of the PostgreSQL database.
  • Default: wapydev

POSTGRES_USER

  • Description: The username for the PostgreSQL database.
  • Default: wapydev

POSTGRES_PASSWORD

  • Description: The password for the PostgreSQL database.
  • Default: Automatically generated by the ./scripts/setup.sh script if not provided.
  • Guide: Run openssl rand -base64 32 to generate a secure password.

DATABASE_URL

  • Description: The connection URL for the PostgreSQL database.
  • Default: Pre-configured based on the default docker-compose.yml setup.

Email Configuration

The following variables are used to configure the email server for handling authentication emails, email notifications and contact form submissions.

EMAIL_SERVER_USER

  • Description: The username for the email server.
  • Default: None

EMAIL_SERVER_PASSWORD

  • Description: The password for the email server.
  • Default: None

EMAIL_SERVER_HOST

  • Description: The hostname of the email server.
  • Default: None
  • Example: smtp.example.com

EMAIL_SERVER_PORT

  • Description: The port used by the email server.
  • Default: 587 (commonly used for SMTP with STARTTLS)
  • Example: 465 (commonly used for SMTP with SSL)

EMAIL_FROM

  • Description: The email address used as the sender for outgoing emails.
  • Default: None
  • Example: [email protected]

EMAIL_CONTACT_EMAIL

  • Description: The email address where contact form submissions will be sent.
  • Default: None
  • Example: [email protected]

Authentication Configuration

The following variables are used to configure the authentication system.

AUTH_SECRET

  • Description: The secret key used for authentication. This is critical for securing user sessions.
  • Default: Automatically generated by the ./scripts/setup.sh script if not provided.
  • Example: a1b2c3d4e5f6g7h8i9j0
  • Guide: Run openssl rand -base64 32 to generate a secure password.

AUTH_TRUST_HOST

  • Description: Determines whether to trust the Host header in the authentication process.
  • Default: true
  • Example: true or false

AUTH_URL

  • Description: The URL of the authentication endpoint. This is automatically derived from the SITE_URL variable.
  • Default: ${SITE_URL}/api/auth
  • Note: There is no need to change this value unless you have a custom setup.

DISABLE_USER_REGISTRATION

  • Description: The URL of the authentication endpoint. This is automatically derived from the SITE_URL variable.
  • Default: false
  • Example: true or false
  • Guide: Disable New User Registration

Github Configuration

The following variables are optional and only required if you want to enable Github login for your application.

GITHUB_CLIENT_ID

GITHUB_CLIENT_SECRET

Google Configuration

The following variables are optional and only required if you want to enable Google login for your application.

GOOGLE_CLIENT_ID

  • Description: The client ID for the Google OAuth application.
  • Default: None

GOOGLE_CLIENT_SECRET

  • Description: The client secret for the Google OAuth application.
  • Default: None

Keycloak Configuration

The following variables are required if you want to enable Keycloak login for your application.

KEYCLOAK_ID

KEYCLOAK_SECRET

KEYCLOAK_ISSUER

Authentik Configuration

The following variables are required if you want to enable Authentik login for your application.

AUTHENTIK_ID

AUTHENTIK_SECRET

AUTHENTIK_ISSUER

Push Notifications

The following variables are optional and only required if you want to enable push notifications for your application.

NEXT_PUBLIC_VAPID_PUBLIC_KEY

  • Description: The public key for the Web Push API, used to send push notifications to users.
  • Default: Automatically generated by the ./scripts/setup.sh script if not provided.
  • Guide: Run npx --yes web-push generate-vapid-keys --json to generate keys and copy publicKey field.

VAPID_PRIVATE_KEY

  • Description: The private key for the Web Push API, used to authenticate push notifications.
  • Default: Automatically generated by the ./scripts/setup.sh script if not provided.
  • Guide: Run npx --yes web-push generate-vapid-keys --json to generate keys and copy privateKey field.

Subscription Secret

The following variable is required for signing subscription-related data.

SUBSCRIPTION_JWT_SECRET

  • Description: The secret key used for signing subscription-related JWTs (JSON Web Tokens).
  • Default: Automatically generated by the ./scripts/setup.sh script if not provided.
  • Guide: Run openssl rand -base64 32 to generate a secure password.

Topics

Getting Started
Learn how to install the application with Docker.

Environment Variables
Learn how to configure the application.

Single Sign-On (SSO) Alternatives
Find detailed instructions on how to configure login with Keycloak or Authentik.

Self‐Hosting without SMTP Email Server
Find detailed instructions on how to set up and configure Mailpit as a local SMTP server for self-hosted environments.

Webhook Integration
Find detailed instructions on how to use webhook.

Disable New User Registration
Learn how to disable new user registration.

Building Docker Image
Learn how to build the Docker image locally.

Database Backup and Restore
Find detailed instructions on how to back up and restore the database, including automation tips.

Clone this wiki locally