# Get a container for your dapp · Chromia Docs (concept)

> In this section, you’ll complete the steps needed to obtain a container for your dapp.

Source: https://docs.chromia.com/build/deployment/testnet/get-container/

# Get a container for your dapp

On this page

* [Prerequisites](#prerequisites)
* [Step 1: Generate a key pair](#step-1-generate-a-key-pair)
* [Step 2: Lease container space](#step-2-lease-container-space)
* [Keep track of your Container ID](#keep-track-of-your-container-id)

In this section, you’ll complete the steps needed to obtain a container for your dapp.

## Prerequisites

Ensure you have the following before proceeding:

* **tCHR tokens**: Required to lease a container. Follow the instructions in
  [Get test tokens (tCHR)](https://docs.chromia.com/build/deployment/testnet-tokens/) to obtain tokens. This step includes creating a Chromia account if
  you don’t already have one.
* **Chromia CLI and a public-private key pair**: Install Chromia CLI using the
  [CLI installation guide](https://docs.chromia.com/get-started/installation/), then generate a key pair specifically for the testnet
  container by following the steps below.

## Step 1: Generate a key pair

With Chromia CLI installed, you’ll need to create a public-private key pair for your **testnet container**. This key
pair is separate from the wallet key used to receive tCHR tokens. Run the following command and specify a key ID to keep
it easily identifiable. For example:

Terminal

```
chr keygen --key-id="testnet_container_key"
```

This command will save your key pair in the `.chromia` folder:

* **Public key**: `.chromia/testnet_container_key.pubkey`
* **Private key**: `.chromia/testnet_container_key`

info

Using a custom key ID, like `"testnet_container_key"`, helps you manage multiple keys and identify specific purposes
(e.g., for testnet use). If you use `chr keygen` without specifying a key ID, it will default to `chromia_key`. Be aware
that using this default key ID can risk overwriting the key if `chr keygen` is run again without specifying an ID.

danger

Keep your private key secure. You may share the public key, but the private key should never be shared.

For more information, see the [keygen documentation](https://docs.chromia.com/build/cli/commands/keygen/).

## Step 2: Lease container space

With tCHR tokens in your account and your key pair ready, you can now lease a container.

1. **Visit the Chromia Testnet Vault**: Go to <https://vault.testnet.chromia.com/containers/> and connect your wallet.
2. Click the **Lease a container** button.
3. Select your container cluster.
4. **Enter your public key**: Locate your public key at `.chromia/testnet_container_key.pubkey` (or the filename you
   specified with `--key-id`) and enter it when requested. You can also adjust for
   [SCUs, storage, and duration](https://docs.chromia.com/get-started/about/hosting/) and enable auto-renewal for the lease.
5. Once you accept the total price for the given configuration, click **Lease**. Complete the leasing process by signing
   with your wallet when prompted. Once the process is finalized, you’ll
   receive a **Container ID**, which is essential for deploying your dapp.

### Keep track of your Container ID

You’ll need your **Container ID** later to deploy your dapp. Feel free to note it down or retrieve it anytime by going
to the [Chromia Testnet Vault Container lease page](https://vault.testnet.chromia.com/containers/) and viewing your
containers.

[View this page on docs.chromia.com](https://docs.chromia.com/build/deployment/testnet/get-container/)Content mirrored from the live docs
