Get started with Chromia
On this page
- Dev container
- Set up the Chromia dev container
- Prerequisites
- Quick Start
- What's included
- Benefits
- GitHub Codespace
- Set up GitHub Codespaces
- Local install
- Install components manually
- Set up PostgreSQL database
- PostgreSQL (macOS)
- Chromia CLI (macOS)
- PostgreSQL (Linux)
- Chromia CLI (Linux)
- PostgreSQL (Windows)
- Chromia CLI (Windows)
- PostgreSQL (Docker)
- Chromia CLI (Docker)
- IDE Plugins
Choose how to set up your Chromia development environment:
- Dev container — a pre-built Docker environment with Chromia CLI, PostgreSQL, Postchain Management Console, and the Rell VS Code extension already installed and configured. Recommended if you want to start building quickly or keep your host machine clean. Requires Docker and VS Code.
- GitHub Codespaces — run a cloud-based dev environment directly in your browser without installing anything locally.
- Local install — install each component directly on your machine. Choose this if you need full control over versions and system configuration, or prefer not to use Docker.
Set up the Chromia dev container
This setup approach provides a fully pre-configured development environment using Docker and development containers, eliminating the need to manually install and configure individual components.
Prerequisites
Before starting, ensure you have the following available on your machine:
- Docker
- VS Code or a VS Code-based IDE (Cursor, Windsurf, etc.)
- Dev Containers Extension in your VS Code
Note: This approach also works with JetBrains IDEs (IntelliJ, PyCharm, etc.), but the Ultimate edition is required for the dev container plugin support.
Quick Start
1. Create a new Rell dapp project
Run the following command in your terminal to create a new template project:
docker run --rm -u $(id -u):$(id -g) -v "$(pwd):$(pwd)" -w "$(pwd)" registry.gitlab.com/chromaway/core-tools/chromia-cli/chr:latest chr create-rell-dapp --devcontainer project-nameThis creates a new template project named "project-name" in your current directory. If you want to use a different name,
simply change the project-name value in the command.
Windows Command Prompt users
If you're using Windows Command Prompt (cmd), replace $(pwd) with %CD% and remove the -u $(id -u):$(id -g) flag in
the Docker command:
docker run --rm -v "%CD%:%CD%" -w "%CD%" registry.gitlab.com/chromaway/core-tools/chromia-cli/chr:latest chr create-rell-dapp --devcontainer project-nameThe $(pwd) syntax works in PowerShell and Unix-based shells (bash, zsh), but Windows Command Prompt uses %CD% for
the current directory. The -u $(id -u):$(id -g) flag is not needed on Windows.
2. Open the project
Open the newly created project folder in VS Code.
When you open the project in VS Code and have the Dev Containers extension installed, VS Code will automatically detect that this is a dev container project and suggest you reopen it in a container. You'll see a notification like this:
Click "Reopen in Container". This will:
- Build and start the development container
- Install all necessary dependencies
- Configure the development environment
- Provide access to all Chromia development tools
🎉 Congratulations! You're now ready to start developing!
Once the dev container is running, you can use the integrated terminal in VS Code to run Chromia CLI commands like
chr test, chr build, and more. The full development environment is ready to use with no additional configuration
required.
What's included
The dev container comes pre-configured with:
- Rell Extension for VS Code
- PostgreSQL
- Chromia CLI
- Postchain Management Console (PMC)
- Proper environment configuration
Benefits
- No manual installation: All components are pre-installed and configured
- Consistent environment: Same setup across different machines and team members
- Isolated development: Development environment is completely isolated from your system
- Quick setup: Get started in minutes instead of hours
- Cross-platform: Works on Windows, macOS, and Linux
Set up GitHub Codespaces
Get started immediately in your browser without installing dependencies:
Or create one manually:
- Go to the hello-world-chromia template.
- Click the green Use this template button.
- Select Open in a codespace.
Install components manually
Set up PostgreSQL database
💡 Why does Chromia use PostgreSQL?
Chromia uses PostgreSQL as its storage layer because blockchains are essentially databases. When you run
chr node start, your Rell code runs on top of PostgreSQL, storing all blockchain data in relational tables.
Benefits of this approach:
- Powerful queries: Leverage SQL's full querying capabilities
- Familiar tooling: Use standard database tools to inspect blockchain data
- Efficient storage: Relational databases are optimized for the type of data blockchains store
- Built-in indexing: No need for separate indexing solutions
This is different from most blockchains but gives you powerful query capabilities right out of the box!
Default database configuration for Rell
- Database name:
postchain - User:
postchain - Password:
postchain
PostgreSQL (macOS)
-
Install Homebrew (if not already installed):
Output/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" -
Install PostgreSQL:
Terminalbrew install postgresql@16 brew services start postgresql@16 export PATH="$(brew --prefix postgresql@16)/bin:$PATH" createuser -s postgres -
Prepare the PostgreSQL database:
Terminalpsql -U postgres -c "CREATE DATABASE postchain WITH TEMPLATE = template0 LC_COLLATE = 'C.UTF-8' LC_CTYPE = 'C.UTF-8' ENCODING 'UTF-8';" -c "CREATE ROLE postchain LOGIN ENCRYPTED PASSWORD 'postchain'; GRANT ALL ON DATABASE postchain TO postchain;"Fix "invalid LC_COLLATE locale name" issue
You might see this message if your system doesn't support the 'C.UTF-8' locale. To fix it, follow these steps:
-
Check which UTF-8 locales your system supports:
Terminallocale -a | grep -i utf-8 -
Create the database using a valid locale:
Replace 'C.UTF-8' with your system's valid locale (for both LC_COLLATE and LC_CTYPE):
Terminalpsql -U postgres -c "CREATE DATABASE postchain WITH TEMPLATE = template0 ENCODING = 'UTF8' LC_COLLATE = 'en_US.UTF-8' LC_CTYPE = 'en_US.UTF-8';" -c "CREATE ROLE postchain LOGIN ENCRYPTED PASSWORD 'postchain'; GRANT ALL ON DATABASE postchain TO postchain;"
Typical macOS UTF-8 locales:
en_US.UTF-8en_GB.UTF-8
After running the command with a supported locale, your database should be created successfully.
Fix peer authentication failed
If you get an error saying peer authentication failed, change the authentication method from
peertomd5in thepg_hba.conffile. -
Chromia CLI (macOS)
-
Install Homebrew (if needed):
Output/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" -
Tap Chromia:
Terminalbrew tap chromia/core https://gitlab.com/chromaway/core-tools/homebrew-chromia.git -
Install CLI:
Terminalbrew install chromia/core/chr -
Verify:
Terminalchr --version
PostgreSQL (Linux)
-
Update your package manager and install PostgreSQL:
Terminalsudo apt update sudo apt install postgresql-16 -
Start PostgreSQL and set up the database:
Terminalsudo service postgresql start sudo -u postgres psql -c "CREATE DATABASE postchain WITH TEMPLATE = template0 LC_COLLATE = 'C.UTF-8' LC_CTYPE = 'C.UTF-8' ENCODING 'UTF-8';" -c "CREATE ROLE postchain LOGIN ENCRYPTED PASSWORD 'postchain'; GRANT ALL ON DATABASE postchain TO postchain;"Fix "invalid LC_COLLATE locale name" issue
You might see this message if your system doesn't support the 'C.UTF-8' locale. To fix it, follow these steps:
-
Check which UTF-8 locales your system supports:
Terminallocale -a | grep -i utf-8 -
Create the database using a valid locale:
Replace 'C.UTF-8' with your system's valid locale (for both LC_COLLATE and LC_CTYPE):
Outputsudo -u postgres psql -c "CREATE DATABASE postchain WITH TEMPLATE = template0 ENCODING = 'UTF8' LC_COLLATE = 'en_US.UTF-8' LC_CTYPE = 'en_US.UTF-8';" -c "CREATE ROLE postchain LOGIN ENCRYPTED PASSWORD 'postchain'; GRANT ALL ON DATABASE postchain TO postchain;"
Typical Linux UTF-8 locales:
en_US.UTF-8en_GB.UTF-8C.UTF-8
After running the command with a supported locale, your database should be created successfully.
-
Chromia CLI (Linux)
-
Trust Chromia apt key:
Terminalcurl -fsSL https://apt.chromia.com/chromia.gpg | sudo tee /usr/share/keyrings/chromia.gpg >/dev/nullTo check it, run
gpg --show-keys /usr/share/keyrings/chromia.gpg. The fingerprint must be8F4A 0EA8 F036 6411 4AEA D02A 17D0 120D E6D7 0A71. -
Add repo:
Terminalecho "deb [arch=amd64 signed-by=/usr/share/keyrings/chromia.gpg] https://apt.chromia.com stable main" | sudo tee /etc/apt/sources.list.d/chromia.list -
Update:
Terminalsudo apt-get update -
Install:
Terminalsudo apt-get install chr -
Verify:
Terminalchr --version
PostgreSQL (Windows)
Option 1: Using WSL (Windows Subsystem for Linux) within Windows
-
Install WSL and a Linux distribution (e.g., Ubuntu) from the Microsoft Store.
-
Open the WSL terminal and install PostgreSQL:
Terminalsudo apt update sudo apt install postgresql-16 -
Start PostgreSQL and set up the database:
Terminalsudo service postgresql start sudo -u postgres psql -c "CREATE DATABASE postchain WITH TEMPLATE = template0 LC_COLLATE = 'C.UTF-8' LC_CTYPE = 'C.UTF-8' ENCODING 'UTF-8';" sudo -u postgres psql -c "CREATE ROLE postchain LOGIN ENCRYPTED PASSWORD 'postchain'; GRANT ALL ON DATABASE postchain TO postchain;"Fix "invalid LC_COLLATE locale name" issue
You might see this message if your system doesn't support the 'C.UTF-8' locale. To fix it, follow these steps:
-
Check which UTF-8 locales your system supports:
Terminallocale -a | grep -i utf-8 -
Create the database using a valid locale:
Replace 'C.UTF-8' with your system's valid locale (for both LC_COLLATE and LC_CTYPE):
Outputsudo -u postgres psql -c "CREATE DATABASE postchain WITH TEMPLATE = template0 ENCODING = 'UTF8' LC_COLLATE = 'en_US.UTF-8' LC_CTYPE = 'en_US.UTF-8';" sudo -u postgres psql -c "CREATE ROLE postchain LOGIN ENCRYPTED PASSWORD 'postchain'; GRANT ALL ON DATABASE postchain TO postchain;"
Typical WSL UTF-8 locales:
en_US.UTF-8en_GB.UTF-8C.UTF-8
After running the command with a supported locale, your database should be created successfully.
-
Option 2: Using native installer (Windows 11 recommended)
-
Download the PostgreSQL installer from the official website.
-
Install the executable and add the PostgreSQL folder containing the binaries to your environment variables. Open the Windows PowerShell using
Run as administratorand run the following command, ensuring that you set the path to your binaries correctly and replace the<version>placeholder with the actual version number:Command promptsetx POSTGRESQL "C:\Program Files\PostgreSQL\<version>\bin" /M -
Check if the environment variables are set correctly:
Command promptecho %POSTGRESQL% -
Open a new Windows PowerShell as normal user to make sure the environment variables are in effect. Prepare the PostgreSQL database by running the following two commands sequentially:
Terminalpsql -U postgres -c "CREATE DATABASE postchain WITH TEMPLATE = template0 LOCALE_PROVIDER icu ICU_LOCALE = 'und-u-kf-upper' LC_COLLATE = 'und-u-kf-upper' LC_CTYPE = 'und-u-kf-upper' ENCODING 'UTF-8';" psql -U postgres -c "CREATE ROLE postchain LOGIN ENCRYPTED PASSWORD 'postchain'; GRANT ALL ON DATABASE postchain TO postchain;"Fix "invalid ICU locale name" issue
You might see this message if your system doesn't support the ICU locale configuration. To fix it, create the database without the LOCALE_PROVIDER parameters:
Terminalpsql -U postgres -c "CREATE DATABASE postchain WITH TEMPLATE = template0 ENCODING 'UTF-8';" psql -U postgres -c "CREATE ROLE postchain LOGIN ENCRYPTED PASSWORD 'postchain'; GRANT ALL ON DATABASE postchain TO postchain;"After running the command with a supported locale, your database should be created successfully.
Chromia CLI (Windows)
-
Open PowerShell as Administrator and allow scripts:
PowerShellSet-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser -
Install Scoop:
PowerShellInvoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression -
Add buckets:
PowerShellscoop bucket add chromia https://gitlab.com/chromaway/core-tools/scoop-chromia.git scoop bucket add java -
Install CLI:
PowerShellscoop install chr -
Verify:
PowerShellchr --version
PostgreSQL (Docker)
Using Docker is a simple and reliable way to set up PostgreSQL. It avoids platform-specific issues and ensures a consistent environment.
-
Install Docker Desktop for your operating system.
-
Run the following command to pull and start a PostgreSQL container:
Terminaldocker run --name postgres -e POSTGRES_USER=postchain -e POSTGRES_PASSWORD=postchain -p 5432:5432 -d postgres:16.3-alpine3.20 -
Verify that the container is running:
Terminaldocker ps
Chromia CLI (Docker)
Using Docker is a great way to run Chromia CLI because it gives you an isolated, consistent environment.
Install Docker
Install Docker on your host OS:
Make sure PostgreSQL is running/configured (see section above).
Run the CLI via Docker
Run the latest CLI image and invoke chr:
docker run --rm -v "$(pwd):$(pwd)" -w "$(pwd)" registry.gitlab.com/chromaway/core-tools/chromia-cli/chr:latest chrDatabase host settings when using Docker
Configure chromia.yml depending on your OS:
| Operating system | Database host configuration |
|---|---|
| macOS | Set database:host to host.docker.internal |
| Windows | Set database:host to 172.17.0.1 |
| Linux | Use --network=host in the Docker run command |
For more details, see the database section of the chromia.yml
configuration file.
Wrapper script (optional)
To avoid having to repeat the full docker run … chr prefix every time, you can use a wrapper script like the
following:
#!/bin/sh
# Allocate a pseudo-TTY when run in interactive mode
if [ -t 0 ] && [ -t 1 ] ; then TTY="--tty"; else TTY=""; fi
docker run \
--network=host \
-e TZ=$(cat /etc/timezone) \
--user $(id -u):$(id -g) \
--mount type=bind,source="/etc/passwd",target=/etc/passwd,readonly \
--mount type=bind,source="/etc/group",target=/etc/group,readonly \
-e SSH_AUTH_SOCK=$SSH_AUTH_SOCK \
--volume "$SSH_AUTH_SOCK:$SSH_AUTH_SOCK" \
--mount type=bind,source="${HOME}/.ssh",target=${HOME}/.ssh,readonly \
--mount type=bind,source="${HOME}/.config/jgit",target=${HOME}/.config/jgit \
--mount type=bind,source="$(pwd)",target="$(pwd)" \
--workdir "$(pwd)" \
--interactive ${TTY} \
--rm \
registry.gitlab.com/chromaway/core-tools/chromia-cli/chr:${CHR_VERSION:-latest} chr "$@"IDE Plugins
For a smoother editing experience, install the Rell extension in VS Code or a compatible IDE (such as Cursor or Windsurf).
- Click the Extensions icon in the Activity Bar on the side of VS Code or go to the menu View | Extensions.
- Enter 'Rell' in the search box, and you should see the extension named Rell in the list.
- Press the Install button.

To install the Rell plugin:
- Open Settings | Plugins.
- Click the Marketplace tab and type 'Rell' in the search box, and you should see the extension named Rell in the list.
- Press the Install button.