# Zero to a running dapp in 10 minutes · Chromia Docs (concept)

> Install the Chromia CLI, create a Rell dapp, run it on a local node, query it and send a transaction. Every command and output was run on 1 Nov 2026 (chr 0.34.3, Rell 0.16.7, Java 21).

Source: https://docs.chromia.com/get-started/

No install? Try Rell in the browser: https://docs.chromia.com/playground/

## 1. Install the Chromia CLI

Linux (Debian / Ubuntu), tested:

```bash
curl -fsSL https://apt.chromia.com/chromia.gpg | sudo tee /usr/share/keyrings/chromia.gpg >/dev/null
echo "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
sudo apt-get update
sudo apt-get install chr
```

If apt says `E: Unable to correct problems, you have held broken packages.`, your distribution has no Java 21 (Debian 12 ships Java 17). Add Java 21 from Eclipse Temurin, then install chr again:

```bash
sudo apt-get install -y wget apt-transport-https gpg
wget -qO - https://packages.adoptium.net/artifactory/api/gpg/key/public | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/adoptium.gpg >/dev/null
echo "deb https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | sudo tee /etc/apt/sources.list.d/adoptium.list
sudo apt-get update && sudo apt-get install -y temurin-21-jre
sudo apt-get install chr
```

macOS (Homebrew), from the official docs, not run in this test:

```bash
brew tap chromia/core https://gitlab.com/chromaway/core-tools/homebrew-chromia.git
brew install chromia/core/chr
```

Check:

```bash
chr --version
```
```
chr version 0.34.3
rell version 0.16.7
postchain version 3.49.21
EIF version 0.32.7
Java version 21.0.13
```

## 2. Set up PostgreSQL

Linux, tested (Debian 12 has no `postgresql-16` package; its own `postgresql`, version 15, works):

```bash
sudo apt-get install postgresql
sudo 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;"
```

No `service` command (e.g. in a container)? `sudo pg_ctlcluster 15 main start`.

macOS (Homebrew), from the official docs, not run in this test:

```bash
brew install postgresql@16
brew services start postgresql@16
export PATH="$(brew --prefix postgresql@16)/bin:$PATH"
createuser -s postgres
psql -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;"
```

## 3. Create a dapp

```bash
chr create-rell-dapp
cd my-rell-dapp
```

src/main.rell:

```rell
module;

object my_name {
    mutable name = "World";
}

operation set_name(name) {
    my_name.name = name;
}

query hello_world() = "Hello %s!".format(my_name.name);
```

- `object my_name` is a single row stored on chain, starting as "World".
- `operation set_name` changes state inside a transaction.
- `query hello_world` reads state.

## 4. Run the tests

```bash
chr test
```
```
====================Running unit tests====================
TEST: test.arithmetic_test:test_foo
OK: test.arithmetic_test:test_foo (0.806s)
TEST: test.arithmetic_test:test_bar
OK: test.arithmetic_test:test_bar (0.458s)
TEST: test.data_test:test_add_name
OK: test.data_test:test_add_name (1.233s)
…
SUMMARY: 0 FAILED / 3 PASSED / 3 TOTAL (2.498s)

***** OK *****
```

## 5. Start a local node

Leave it running; use a second terminal for the next steps.

```bash
chr node start --wipe
```
```
Started blockchain my_rell_dapp. Chain-id: 0, brid F6438317F85A756AE5E41485AF846D1D4F27EB1F8BE5FA2B6E27553AC558F091
Node is initialized
```

## 6. Query

```bash
chr query hello_world
```
```
"Hello World!"
```

## 7. Send a transaction

```bash
chr tx set_name Alice --await
chr query hello_world
```
```
transaction with rid B28ECA83E1BFBDE7C63EE67D1957970D014882C0C49AE8A63644C126C94C222E was posted and confirmed
"Hello Alice!"
```

## 8. Change the code and redeploy

Append to src/main.rell: `query greeting_length() = my_name.name.size();`

```bash
chr node update
```
```
Building Blockchain: my_rell_dapp
Configuration added at height 3
```

The new code takes effect from that block height. The local node builds a block only when a transaction arrives, so send one:

```bash
chr tx set_name Bob --await
chr query greeting_length
```
```
3
```

## 9. Deploy to Testnet

Commands and flags checked against chr 0.34.3; not deployed in this test (needs a leased container and tCHR). Full walkthrough: https://docs.chromia.com/get-started/create-dapp/deploy-to-testnet/

```bash
chr keygen --key-id testnet_container_key
# lease a container at vault.testnet.chromia.com/containers with the printed pubkey,
# add the deployments block to chromia.yml, then:
chr deployment create --network testnet --key-id testnet_container_key
```

## How this page was tested

- Steps 1–4: script on a brand-new Debian 12 machine (2 CPUs, 473 MB RAM), 1 Nov 2026. Transcript: https://docs.chromia.com/get-started/setup-log.txt
- Steps 5–8: Debian 12 workstation, same CLI, empty home directory. The node needs more than 473 MB RAM (give it at least 1 GB).
- Re-run for r30 on 3 Nov 2026: steps 3 and 5–8 with chr 0.34.3, a fresh project and an empty home directory; every output matched, including both transaction ids.
- Not run: macOS tabs (verbatim from the official guide), Windows, the testnet deployment itself (step 9 commands checked against chr --help).
