# Deploy your dapp to Testnet · Chromia Docs (concept)

> Deploy the Hello World dapp to Chromia Testnet: get tCHR, lease a container, configure chromia.yml, deploy with chr and call your dapp. Checked with chr 0.34.3.

Source: https://docs.chromia.com/get-started/create-dapp/deploy-to-testnet/

Take the Hello World dapp from the [getting-started tutorial](https://docs.chromia.com/get-started/) onto the public Testnet: get test tokens, lease a container, deploy, then call your dapp over the network.

**You need:** the project from [step 3 of the tutorial](https://docs.chromia.com/get-started/#create-a-dapp) (a running local node is not needed), a Web3 wallet such as MetaMask, about 15 minutes. Run every command from the project folder.

What was checked for r30 (3 Nov 2026)

- Every command and flag on this page exists in `chr 0.34.3` (`--help` of keygen, deployment create/update/info, tx, query).
- A `testnet` deployment with only a `container` is accepted: chr fills in the Testnet node URL and directory-chain id itself.
- The Faucet, the Vault containers page and the Testnet status endpoint answer; the directory-chain id below matches what the Testnet node reports.
- **Not run:** the deployment itself, which needs a leased container and tCHR. Outputs on this page that come from a deploy are marked.

## 1. Get tCHR

Connect your wallet on the [Chromia Testnet Faucet](https://faucet.testnet.chromia.com/) and request tCHR. You pay for the container lease with it.

## 2. Create a container key

Run 3 Nov 2026

This key owns your container and signs the deployment.

```
chr keygen --key-id testnet_container_key
```

chr saves three files in `~/.chromia/`: `testnet_container_key`, `testnet_container_key.pubkey` and `testnet_container_key_mnemonic`. Print the public key again at any time with:

```
chr keygen --get-pubkey=testnet_container_key
```

## 3. Lease a container

Vault screens not walked in this test

Open [Containers in the Testnet Vault](https://vault.testnet.chromia.com/containers/), connect the same wallet, and lease a container. Paste the **pubkey** from step 2 when the Vault asks for the container owner. Copy the **Container ID** it gives you.

## 4. Configure chromia.yml

Config accepted by chr 0.34.3

Give the blockchain a name nobody else has used (the tutorial’s `my_rell_dapp` is taken by everyone who followed it), then add the `testnet` deployment with your Container ID:

```
blockchains:
  hello_alice_42:            # pick your own unique name (was my_rell_dapp)
    module: main
compile:
  rellVersion: 0.16.6
database:
  schema: schema_my_rell_dapp
test:
  modules:
    - test
deployments:
  testnet:
    container: <container_id>   # from the Vault
```

Naming the deployment `testnet` is what lets chr fill in the node URL and directory-chain id. Any other name needs `url` and `brid` as well; see [deployment configuration](https://docs.chromia.com/build/configuration/project-config/#deployments).

Per the official guide, Testnet rejects code identical to a dapp already deployed (not tested here). If you kept the tutorial code as is, add a line such as a comment to `src/main.rell` so your build is unique.

## 5. Deploy

Not run: needs a leased container

```
chr deployment create --network testnet --key-id testnet_container_key
```

chr builds the dapp, asks you to confirm (add `-y` to skip the prompt), and prints the new **Blockchain RID** and the transaction id of the deployment.

If it says the deployment is pending, check the transaction on the Testnet directory chain, replacing `{tx_rid}` with the id chr printed:

```
curl "https://node0.testnet.chromia.com/tx/6F1B061C633A992BF195850BF5AA1B6F887AEE01BB3F51251C230930FB792A92/{tx_rid}/status"
```

`{"status":"confirmed"}` means it went through. `"unknown"` means the node hasn’t seen that id (check you copied it whole).

## 6. Save the Blockchain RID

Add the RID under `chains` so later commands know which chain is yours:

```
deployments:
  testnet:
    container: <container_id>
    chains:
      hello_alice_42: x"<blockchain_rid>"   # from the deploy output
```

Check it:

```
chr deployment info --network testnet
```

## 7. Call your dapp on Testnet

Not run: needs a deployed chain

```
chr tx --network testnet --blockchain hello_alice_42 set_name Deployer --await
chr query --network testnet --blockchain hello_alice_42 hello_world
```

Expected answer: `"Hello Deployer!"`

## 8. Ship an update

Change your Rell code, then:

```
chr deployment update --network testnet --key-id testnet_container_key
```

`--verify-only` checks the new configuration without sending it.

## Troubleshooting

- **“No blockchains configured for deployment ‘testnet’”** from `deployment info` or `update`: step 6 is missing; add the `chains` entry. (Seen in this test.)
- **The deployment is rejected as a duplicate** (from the official guide, not reproduced here): your code matches a chain already on Testnet; change something in `src/main.rell` (step 4).
- **Not enough tCHR / no container:** go back to steps 1 and 3; the deploy fails without a lease.

## Next steps

- [Deployment guide](https://docs.chromia.com/build/deployment/): Mainnet, multiple chains, updates and container management.

- [Accounts & tokens (FT4)](https://docs.chromia.com/build/ft4/intro/): Add user accounts and tokens to your dapp.
