---
title: Use the CLI to add a self-managed region
meta:
   description: Create your own Tinybird Cloud region in the cloud service provider of your choice.
headingMaxLevels: 3
---

# Use the CLI to add a self-managed region

The [tb infra init](/forward/dev-reference/commands/tb-infra) command helps you set up the requirements for a self-managed region and deploy the [Tinybird Local](/forward/install-tinybird/local) container on your cloud provider.

When you run `tb infra init`, the command:

1. Registers a new self-managed region with Tinybird Cloud.
2. Generates infrastructure-as-code files for your chosen cloud provider: A certificate in AWS Certificate Manager and the necessary DNS records in Route 53 for validating the certificate.
3. Generates a Kubernetes configuration file to deploy the container on your EKS cluster with the correct environment variables. The command prompts you for the Kubernetes context to use, the namespace to create the deployment in, and the storage class to use.
4. Optionally, it applies these configurations to create the necessary resources.

This automated approach significantly reduces the manual steps required to set up a self-managed region, especially on AWS where it handles certificate management, DNS configuration, and Kubernetes deployment.

{% callout type="info" %}
Self-managed regions are currently in beta. Use them for development environments only; avoid production workloads. Features, requirements, and implementation details might change as we continue to improve this capability.
{% /callout %}

## Supported clouds

The following cloud service providers are supported:

- AWS
- GCP (Coming soon)
- Azure (Coming soon)

## Use tb infra init

Follow these steps to create a self-managed region using `tb infra init`.

{% steps %}

### Check the requirements

To run the `tb infra init` command, you need to have the following.

{% snippet title="tbinfra-prerequisites" /%}

### Log into Tinybird Cloud

Log into Tinybird Cloud using the `tb login` command.

```shell
tb login
```

### Run tb infra init

Run `tb infra init` to set up the requirements for a self-managed region and deploy Tinybird Local on your cloud provider.

```shell
tb infra init
```

The command requires the following information:

{% snippet title="tbinfra-init" /%}

Review the changes before applying them. To generate the files without applying them, use the `--skip-apply` flag.

After the deployment is complete, `tb infra` shows the URL to access your Tinybird Local instance.

### Log into your instance

Navigate to your Tinybird project and run `tb login --host <host>`, where `<host>` is the host of your self-managed region that you set up in the previous step.

```shell
tb login --host https://<host>
```

### Use your instance

After you're logged in, you can run commands against it using the `--cloud` flag.

```shell
tb --cloud workspace ls 
```

{% /steps %}

## Troubleshooting

If you encounter issues with your self-managed region:

- Check the container logs for error messages.
- Verify that all required environment variables are set correctly.
- Ensure your network configuration allows the necessary connections.
- Confirm that your persistent volumes are properly mounted and have sufficient space.
- For connectivity issues, verify that your HTTPS endpoint is properly configured.

For additional help, contact Tinybird support with details about your deployment.