Prerequisites
- Git, npm, and Node.js 22.23.4 or later in the Node.js 22 series. The repository’s
.nvmrcselects the project version. - A MySQL or PostgreSQL database and a user that can create and change tables. See Database configuration.
- Redis, reachable from the API.
- Permission to install Chromium system dependencies for chart image rendering.
nvm install and nvm use from the updated repository root, then restart the API and worker processes with the updated Node.js executable. Updating .nvmrc alone does not update a running process.
1. Get the release
ReplaceYOUR_RELEASE_TAG with the tag you want to install from Chartbrew releases.
.env and the client settings. The server install step also installs Chromium through Playwright. If that step fails, correct the reported system dependency or permission error, then run:
2. Set production configuration
Edit.env in the project root. Set the production values without the _DEV suffix.
Generate the encryption key
For a new installation, generate a key and copy it intoCB_ENCRYPTION_KEY:
CB_SECRET placeholder with a separate random value for a new installation; keep the existing value for an upgrade.
Set CB_BULLMQ_USERNAME and CB_BULLMQ_PASSWORD to protect the queue dashboard. If they are empty and .env is writable, startup fills them in automatically. See Environment variables for SMTP and optional integrations.
3. Build and prepare the database
Run these commands from the project root:client/dist. The API runs directly from its source files. Stop if a command fails and correct the error before you start the services.
Client environment values are included at build time. Never put passwords or server secrets in a VITE_APP_* variable. Rebuild the client whenever its public URLs change.
4. Run with PM2
This example uses PM2 to keep one API process and one static client server running. From the project root:pm2 startup to enable startup after a reboot. The --spa option serves index.html for client routes. See PM2’s static server and startup instructions.
Keep port 4018 private through your firewall. The API binds to the address set in CB_API_HOST. Configure Domains and HTTPS before you use the installation publicly.
5. Check and maintain the services
.env, and server/uploads.
After a configuration change, restart the API with pm2 restart chartbrew-api --update-env. Rebuild the client if you changed a VITE_APP_* value. For an application upgrade, stop the API, back up the data, select the release, install dependencies, build, migrate, and restart. Follow the release’s migration notes.