The table below shows the production variables. The development variables have the same naming, but they are appended with _DEV (example: CB_DB_NAME -> CB_DB_NAME_DEV)

VariableDefault valueDescription
CB_DB_NAME
CB_DB_NAME_DEV
required
chartbrewThe name of the database
CB_DB_USERNAME
CB_DB_USERNAME_DEV
required
No defaultThe username of the user that has access to the database
CB_DB_PASSWORD
CB_DB_PASSWORD_DEV
No defaultThe password associated with the database user
CB_DB_HOST
CB_DB_HOST_DEV
required
localhostThe host address where the database is located
CB_DB_PORT
CB_DB_PORT_DEV
3306The port of the hosting address
CB_DB_DIALECT
CB_DB_DIALECT_DEV
required
mysqlWhich database to use between mysql and postgres
CB_DB_CERT
CB_DB_CERT_DEV
No defaultIf your DB requires an SSL connection, use this variable to provide the string value of the certificate
CB_ENCRYPTION_KEY
CB_ENCRYPTION_KEY_DEV
required
A key will be generate for you during the first runA secure 32 bytes string which is used to encrypt the data in the database. Click here to see how you can generate a key.
CB_OPENAI_API_KEY
CB_OPENAI_API_KEY_DEV
No defaultThe API key for the OpenAI API
CB_OPENAI_MODEL
CB_OPENAI_MODEL_DEV
gpt-4o-miniThe model to use for the OpenAI API
CB_REDIS_HOST
CB_REDIS_HOST_DEV
localhostThe host address where the Redis server is located
CB_REDIS_PORT
CB_REDIS_PORT_DEV
6379The port of the Redis server
CB_REDIS_PASSWORD
CB_REDIS_PASSWORD_DEV
No defaultThe password for the Redis server, if required
CB_REDIS_DB
CB_REDIS_DB_DEV
0The Redis database number to use
CB_REDIS_CA
CB_REDIS_CA_DEV
No defaultThe string value of the certificate
CB_API_HOST
CB_API_HOST_DEV
required
localhostThe address where the server app is running from. This variable is used internally by the server app.
This value is overwritten by the PORT variable (if set)
CB_API_PORT
CB_API_PORT_DEV
required
4019The port where the server app is running from. This variable is used internally by the server app
VITE_APP_CLIENT_HOST
VITE_APP_CLIENT_HOST_DEV
required
http://localhost:4018The full address where the client app is running from. This variable is used in the client app and it’s populated during the building process.

Note The app needs to be restarted/rebuilt when this value is changed.
VITE_APP_CLIENT_PORT
VITE_APP_CLIENT_PORT_DEV
required
4018The port where the client app is running from. This variable is used in the client app and it’s populated during the building process.

Note The app needs to be restarted/rebuilt when this value is changed.
VITE_APP_API_HOST
VITE_APP_API_HOST_DEV
required
http://localhost:4019The full address where the server app is running. This variable is used by the client app.

Note The app needs to be restarted/rebuilt when this value is changed.
CB_MAIL_HOST
CB_MAIL_HOST_DEV
smtp.gmail.comThe server host of the email provider
CB_MAIL_USER
CB_MAIL_USER_DEV
No defaultThe username used to log in on the email server
CB_MAIL_PASS
CB_MAIL_PASS_DEV
No deafultThe password used to log in on the email server
CB_MAIL_PORT
CB_MAIL_PORT_DEV
465The port used to connect to the email server
CB_MAIL_SECURE
CB_MAIL_SECURE_DEV
truetrue - Use SSL to connect to the email server

false - Use TLS to connect to the email server
CB_ADMIN_MAIL
CB_ADMIN_MAIL_DEV
[email protected]The email address used to send the emails from
CB_RESTRICT_TEAMS
CB_RESTRICT_TEAMS_DEV
00 - New users will have their own team created on sign-up.

1 - New users don’t have a team on signup and can’t create their own.
CB_RESTRICT_SIGNUP
CB_RESTRICT_SIGNUP_DEV
00 - Anyone can create accounts from the signup page

1 - New users can only sign up using invite links
CB_GOOGLE_CLIENT_ID
CB_GOOGLE_CLIENT_ID_DEV
No defaultGoogle app Client ID generated from the Console

(Needed for Google integrations)
CB_GOOGLE_CLIENT_SECRET
CB_GOOGLE_CLIENT_SECRET_DEV
No defaultGoogle app Client Secret generated from the Console

(Needed for Google integrations)
CB_BACKEND_WORKERS
CB_BACKEND_WORKERS_DEV
4Some background tasks in Chartbrew will use workers to spread work on multiple threads. Still testing, but for best performance, set this to the number of threads your CPU has
CB_OPENAI_API_KEY
CB_OPENAI_API_KEY_DEV
No defaultThe API key for the OpenAI API
CB_OPENAI_MODEL
CB_OPENAI_MODEL_DEV
gpt-4o-miniThe model to use for the OpenAI API

Generate the encryption key

You will need a 32 bytes AES encryption key for the CB_ENCRYPTION_KEY variable. Chartbrew generates both CB_ENCRYPTION_KEY and CB_ENCRYPTION_KEY_DEV for you during the first run, but if you wish to have control over the value, you can generate it yourself.

Run the following command to generate a valid key:

node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"