Skip to content

Environment Variables

Complete reference of all environment variables available when self-hosting Kitbase. All variables are configured in your .env file.

Required

VariableDescription
JWT_SECRETSecret key for JWT tokens. Generate with openssl rand -base64 32
DATABASE_PASSWORDMySQL root password

App Settings

VariableDefaultDescription
PORT80Port to expose the dashboard and API
APP_DOMAINlocalhostYour domain name (without protocol)
APP_PROTOCOLhttphttp or https
SUPPORT_EMAILsupport@localhostSupport contact email shown to users

Email

Required for password resets, invitations, and notifications. Kitbase supports three email providers: SMTP, AWS SES, and Resend. See the Email Providers guide for setup details and switching instructions.

Common

VariableDefaultDescription
MAIL_PROVIDERsmtpEmail provider: smtp, ses, or resend
MAIL_FROMnoreply@localhostSender email address
MAIL_INVITATION_SUBJECTYou've been invited to join an organizationInvitation email subject line
MAIL_BASE_URLhttp://localhostBase URL used in email links

SMTP (when MAIL_PROVIDER=smtp)

VariableDefaultDescription
SMTP_HOSTSMTP server hostname
SMTP_PORT587SMTP server port
SMTP_USERNAMESMTP username
SMTP_PASSWORDSMTP password
SMTP_AUTHtrueEnable SMTP authentication
SMTP_STARTTLStrueEnable STARTTLS
SMTP_STARTTLS_REQUIREDtrueRequire STARTTLS
SMTP_CONNECTION_TIMEOUT5000Connection timeout in ms
SMTP_TIMEOUT5000Read timeout in ms
SMTP_WRITE_TIMEOUT5000Write timeout in ms

AWS SES (when MAIL_PROVIDER=ses)

VariableDefaultDescription
SES_ACCESS_KEYAWS access key ID
SES_SECRET_KEYAWS secret access key
SES_REGIONus-east-1AWS region for SES
SES_ENDPOINTCustom SES endpoint (optional, for testing with LocalStack)

TIP

The MAIL_FROM address must be verified in your AWS SES account. If your account is in the SES sandbox, recipient addresses must also be verified.

Resend (when MAIL_PROVIDER=resend)

VariableDefaultDescription
RESEND_API_KEYResend API key (starts with re_)

TIP

The MAIL_FROM address must use a domain you've verified in your Resend dashboard. For testing, you can use onboarding@resend.dev.

Database (MySQL)

TIP

You only need to change these if you're using an external MySQL instance instead of the bundled container.

VariableDefaultDescription
DATABASE_URLjdbc:mysql://mysql:3306/flyway_db?...JDBC connection URL
DATABASE_USERNAMErootMySQL username
DATABASE_PASSWORDrootMySQL password

ClickHouse

VariableDefaultDescription
CLICKHOUSE_URLjdbc:clickhouse://clickhouse:8123/analyticsJDBC connection URL
CLICKHOUSE_USERNAMEdefaultClickHouse username
CLICKHOUSE_PASSWORDclickhouse123ClickHouse password

Redis

VariableDefaultDescription
REDIS_HOSTredisRedis hostname
REDIS_PORT6379Redis port

Optional

OAuth

Google

VariableDefaultDescription
OAUTH_GOOGLE_CLIENT_IDGoogle OAuth client ID
OAUTH_GOOGLE_CLIENT_SECRETGoogle OAuth client secret
OAUTH_GOOGLE_REDIRECT_URIhttp://localhost/api/auth/oauth/google/callbackOAuth callback URL
OAUTH_GOOGLE_SCOPESopenid email profileOAuth scopes to request

GitHub

VariableDefaultDescription
OAUTH_GITHUB_CLIENT_IDGitHub OAuth client ID
OAUTH_GITHUB_CLIENT_SECRETGitHub OAuth client secret
OAUTH_GITHUB_REDIRECT_URIhttp://localhost/api/auth/oauth/github/callbackOAuth callback URL
OAUTH_GITHUB_SCOPESuser:emailOAuth scopes to request

Slack Integration

VariableDefaultDescription
SLACK_CLIENT_IDSlack app client ID
SLACK_CLIENT_SECRETSlack app client secret
SLACK_REDIRECT_URIhttp://localhost/api/integrations/slack/oauth/callbackSlack OAuth callback URL

Storage

Kitbase uses file storage for OTA update files. By default, files are stored locally. Configure S3 for cloud storage.

VariableDefaultDescription
STORAGE_LOCAL_ROOT_PATH./storageLocal file storage directory
STORAGE_LOCAL_BASE_URLhttp://localhost/api/storagePublic URL for local storage
S3_BUCKET_NAMES3 bucket name (enables S3 storage)
S3_REGIONus-east-1AWS region (use auto for Cloudflare R2)
S3_ACCESS_KEYS3 access key (setting this enables S3 storage)
S3_SECRET_KEYS3 secret key
S3_ENDPOINTCustom S3-compatible API endpoint. Required for non-AWS providers (R2, MinIO, Spaces, GCS). See S3-Compatible Storage
S3_PUBLIC_URLCustom public URL prefix for stored files. Overrides the default AWS URL format

Error Handling

VariableDefaultDescription
ERROR_INCLUDE_STACKTRACEfalseInclude stack traces in API error responses
ERROR_NOTIFICATION_ENABLEDfalseSend email notifications on errors
ERROR_NOTIFICATION_EMAILEmail address for error notifications

Logging

VariableDefaultDescription
LOG_LEVEL_APPINFOApplication log level
LOG_LEVEL_JOOQINFODatabase query log level
LOG_LEVEL_SECURITYWARNSecurity log level

Released under the MIT License.