---
title: tb deployment
meta:
    description: Deploy your project to the Tinybird platform
---

# tb deployment

Deploys your project to the Tinybird platform. Run using `--cloud` to deploy to Tinybird Cloud.

Global options apply to this command. See [Global options](/forward/dev-reference/commands/global-options).

The following subcommands are available:

{% table %}
  * Subcommand
  * Description
  ---
  * create [OPTIONS]
  * Validates and deploys the project in Tinybird.
  ---
  * ls
  * Lists all the deployments of your project.
  ---
  * promote
  * Promotes last deploy to ready and remove old one. Accepts the --wait / --no-wait option.
  ---
  * discard
  * Discards the last deployment. Accepts the --wait / --no-wait option.
{% /table %}

## tb deployment create

Validates and deploys the project in Tinybird. Run using `--cloud` to deploy to Tinybird Cloud. When deploying to Tinybird Cloud, the command shows the URL of the deployment.

{% table %}
  * Option
  * Description
  ---
  * --wait / --no-wait
  * Waits for the deployment to finish. Defaults to not waiting.
  ---
  * --auto / --no-auto
  * Automatically promotes the deployment. Only works if `--wait` is used.
  ---
  * --check / --no-check
  * Validates the deployment before creating it. Disabled by default.
  ---
  * --allow-destructive-operations / --no-allow-destructive-operations
  * Allows destructive operations, like removing data sources, dropping historical data from tables, and so on. Disabled by default.
  ---
  * --template TEXT
  * Deploy from a template name or URL. If a URL is provided, it should point to a valid Tinybird project template.
{% /table %}

{% alert type="warning" %}
Removing data sources is an irreversible operation. Be careful when using the `--allow-destructive-operations` flag.
{% /alert %}

{% callout type="info" %}
The `--check` flag validates external connections to S3, Kafka, GCS, and databases referenced via table functions. For local success, set connection secrets with `tb secret set` and use `tb local start --use-aws-creds` for S3 connections.
{% /callout %}

## tb deployment discard

Discards the current staging deployment. Use this command to cancel an unfinished deployment. The previous live deployment remains active.

When you run `tb deployment discard`, the following happens:

1. The current staging deployment is cancelled.
2. The deployment resources associated with the staging deployment are removed.
3. The previous live deployment remains active.

{% table %}
  * Option
  * Description
  ---
  * --wait / --no-wait
  * Waits for the discard operation to finish. Defaults to not waiting.
{% /table %}

For example, if a deployment is taking a long time due to backfills, you can discard it:

```bash
tb deployment discard --wait
```

{% callout type="info" %}
After discarding, the staging deployment and its resources are removed. Your project continues running on the previous live deployment.
{% /callout %}

## Environment support

{% table %}
  * Environment
  * Supported
  * Description
  ---
  * `--local`
  * ✓ Yes (default)
  * Manages deployments locally.
  ---
  * `--cloud`
  * ✓ Yes
  * Manages deployments in Tinybird Cloud.
  ---
  * `--branch=BRANCH_NAME`
  * ✓ Yes
  * Manages deployments in a branch.
{% /table %}