Skip to main content
Use this guide for local development. For a production installation, start with Deployment overview.

Prerequisites

Node.js 22.23.4 or later in the Node.js 22 series. Use the repository’s .nvmrc to select the project version. NPM MySQL or PostgreSQL, with a dedicated Chartbrew database. The repository includes Compose examples for MySQL 8.4 and PostgreSQL 16. Redis (v6+)

Getting Started

Installation & Setup

The setup doesn’t work in Windows PowerShell or cmd.exe. If you’re using Windows, please use a bash command line like Git Bash or cygwin

Create a Chartbrew database

Chartbrew works with both MySQL and PostgreSQL. You can use any of the two, but you need to create a database first. Follow the instruction here.

Get and setup the project

Set up the environment variables

All the environment variables that need to be set are found in the .env-template file in the root folder of the project. If you ran the setup above, you should already have a .env file there as well. If not, copy the template file and rename it .env. Use the original variable names in every environment. Set your local database and Redis connection values. Keep the default local client and API URLs unless you use different ports. See the full list of variables here

Generate the encryption key

Generate a key and save it as CB_ENCRYPTION_KEY in .env:
Keep this key when you restart or update the application so that saved credentials remain readable.

Prepare the database

Development startup does not apply database migrations. From the project root, run:
The server dependency installation also installs Chromium for chart images. If it fails, correct the reported error and run npm --prefix server run install:playwright.

Run the project locally

Open two terminals, one for front-end and the other for back-end.

Set up Redis for automatic dataset updates

Chartbrew uses queues to update datasets automatically and it uses Redis to achieve this. In order for your datasets and charts to update automatically, you need to set up Redis first. Find out how to set up Redis on various platforms here.. Open http://localhost:4018 and create your first account.

Tech stack

Backend Frontend Docs

Environment variables

See the full list of variables here