Skip to main content

Environment Variables

To configure your application, set the following environment variables. These variables control various aspects of the application's behavior, including URLs, database connections, and third-party integrations.

Application Configuration

VariableExampleDescription
APP_URLhttp://docmost.example.comThe base URL of your application. It is optional, but useful for correct email links.
APP_SECRETrandom_keyA random key used for application security.
PORT3000The port on which the application will run.
JWT_TOKEN_EXPIRES_IN30dThe expiration time for JSON Web Tokens (JWT).

Database Configuration

VariableExampleDescription
DATABASE_URLpostgresql://postgres:password@localhost:5432/docmost?schema=publicThe connection URL for your PostgreSQL database.

Redis Configuration

VariableExampleDescription
REDIS_URLredis://127.0.0.1:6379The connection URL for your Redis server.

Storage Configuration

Using Local storage

VariableExampleDescription
STORAGE_DRIVERlocalThe storage driver to use for file storage.

Using S3-compatible storage

VariableExampleDescription
STORAGE_DRIVERs3The storage driver to use for file storage.
AWS_S3_ACCESS_KEY_IDYour AWS S3 access key ID.
AWS_S3_SECRET_ACCESS_KEYYour AWS S3 secret access key.
AWS_S3_REGIONThe region where your S3 bucket is located.
AWS_S3_BUCKETThe name of your S3 bucket.
AWS_S3_ENDPOINTThe endpoint URL for your S3 service (optional).

Email Configuration

Using SMTP

VariableExampleDescription
MAIL_DRIVERsmtpThe mail driver to use for sending emails.
SMTP_HOSTsmtp.example.comThe SMTP server to use for sending emails.
SMTP_PORT587The port to use for the SMTP server.
SMTP_USERNAMEThe username for the SMTP server.
SMTP_PASSWORDThe password for the SMTP server.
MAIL_FROM_ADDRESS[email protected]The email address that emails will be sent from.
MAIL_FROM_NAMEDocmostThe name that emails will be sent from.

Using Postmark

VariableExampleDescription
MAIL_DRIVERpostmarkThe mail driver to use for sending emails.
POSTMARK_TOKENThe token for Postmark, if using Postmark as the MAIL_DRIVER.
MAIL_FROM_ADDRESS[email protected]The email address that emails will be sent from.
MAIL_FROM_NAMEDocmostThe name that emails will be sent from.