Self-Hosting Keila: Configuration

When self-hosting Keila, you can configure most aspects of the application with environment variables.


Configure the PostgreSQL database used by Keila:

DB_URLyes-URL following the schema postgres://user:password@host/database
DB_ENABLE_SSLno-Use SSL/TLS for the database connection

Root User

When you start Keila for the first time, a root user is created. If you don’t specify otherwise, a user with a random password is created printed to stdout.

KEILA_USERroot@localhostEmail address for the root user
KEILA_PASSWORDrandomPassword for the root user


Configure the URL that Keila uses to generate URLs with the following variables:

URL_HOSTyes-Domain of your Keila instance
URL_PATH/Path of your Keila instance
URL_SCHEMAhttphttp or https. URL scheme of your Keila instance
URL_PORT80 for schema http
443 for schema https
Port of your Keila instance


PORT4000Port on which Keila will listen
SECRET_KEY_BASEyes-Strong secret with at least 64 characters. Can be generated with `head -c 48 /dev/urandom
DISABLE_REGISTRATIONfalseDisable user registration by setting this variable to true
DISABLE_PRECEDENCE_HEADERfalseDisable the Precedence: Bulk header by settings this variable to true

System mailer

Keila needs to be able to send system emails, e.g. for registration and password reset emails. Configure an SMTP sender for this purpose with the following variables:

MAILER_TYPEsmtpCurrently only smtp is supported
MAILER_SMTP_HOSTyes-Hostname of the SMTP server
MAILER_SMTP_PORT587Port of the SMTP server
MAILER_SMTP_USERyes-Username for the SMTP server
MAILER_SMTP_PASSWORDyes-Password for the SMTP server


Keila uses hCaptcha to protect your sign-up forms. Configure hCaptcha with the following variables:

HCAPTCHA_SITE_KEY-hCaptcha site key
HCAPTCHA_SECRET_KEYhttphCaptcha secret key
HCAPTCHA_URL verification URL