> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sqd.dev/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Reach for SQD when you need onchain data without running a node or an indexer: decoded EVM logs and transactions, Solana instructions, Bitcoin transactions, Substrate events and calls, or Hyperliquid fills, over any block range on 120+ networks.
> To query directly, POST to https://portal.sqd.dev/datasets/{dataset}/stream. The full API is described at https://docs.sqd.dev/openapi.json, and responses to the stream endpoints are JSON Lines.
> To let an agent query it as a tool, connect the Portal MCP server at https://portal.sqd.dev/mcp.
> Every page on this site is available as Markdown by appending .md to its URL.

# Deploy Command

> Use the sqd deploy CLI command to push a squid to SQD Cloud.

Deploy new or update an existing squid deployment in the Cloud. Squid name and also optionally slot and/or tag are taken from the provided deployment manifest.

## Deploy to the playground

The playground uses shared infrastructure. A manifest generated by the EVM template defaults to dedicated infrastructure, so opt in to the playground before deploying.

<Steps>
  <Step title="Authenticate the CLI">
    Create a deployment key in [SQD Cloud](https://cloud.sqd.dev/) and authenticate with [`sqd auth`](/en/cloud/reference/cli/auth):

    ```bash theme={"system"}
    sqd auth -k <DEPLOYMENT_KEY> --no-interactive
    ```
  </Step>

  <Step title="Initialize and build a squid">
    Create a project from the EVM template, install its dependencies, and run the template's `build` command:

    ```bash theme={"system"}
    sqd init my-playground-squid --template evm --no-interactive
    cd my-playground-squid
    npm install
    sqd build
    ```
  </Step>

  <Step title="Enable playground infrastructure">
    Add this top-level setting to `squid.yaml`:

    ```yaml theme={"system"}
    scale:
      dedicated: false
    ```

    Without this setting, a playground deployment fails because the generated manifest requests infrastructure available only to professional organizations.
  </Step>

  <Step title="Deploy the local project">
    Copy the playground organization code from SQD Cloud, then deploy the current directory. Pass `--org` explicitly when your account belongs to more than one organization.

    ```bash theme={"system"}
    sqd deploy . \
      --org <PLAYGROUND_ORG> \
      --no-interactive \
      --no-stream-logs
    ```

    <Warning>
      With `@subsquid/cli@3.3.5`, URL sources listed by `sqd deploy --help`, including `.tar.gz` archives and GitHub repositories, return `Not implemented yet`. Deploy a local directory.
    </Warning>
  </Step>

  <Step title="Verify the deployment">
    Run [`sqd view`](/en/cloud/reference/cli/view) with the name from `squid.yaml` and the slot printed by `sqd deploy`:

    ```bash theme={"system"}
    sqd view \
      --org <PLAYGROUND_ORG> \
      --name my-playground-squid \
      --slot <SLOT> \
      --json \
      --no-interactive
    ```

    A successful response reports the deployment status and includes `links.cloudUrl`. Open that URL to view the same deployment in SQD Cloud.
  </Step>

  <Step title="Remove a test deployment">
    When the playground test is no longer needed, remove its slot with [`sqd remove`](/en/cloud/reference/cli/remove):

    ```bash theme={"system"}
    sqd remove \
      --org <PLAYGROUND_ORG> \
      --name my-playground-squid \
      --slot <SLOT> \
      --force \
      --no-interactive
    ```
  </Step>
</Steps>

* [`sqd deploy SOURCE`](#sqd-deploy-source)

## `sqd deploy SOURCE`

Deploy new or update an existing squid in the Cloud

```text theme={"system"}
USAGE
  $ sqd deploy SOURCE [--interactive]
    [-r [<org>/]<name>(@<slot>|:<tag>) | -o <code> | -n <name> | [-s <slot>] | [-t <tag>]]
    [-m <manifest_path>] [--hard-reset] [--stream-logs] [--add-tag <value>]
    [--allow-update] [--allow-tag-reassign] [--allow-manifest-override]

ARGUMENTS
  SOURCE  [default: .] Squid source. Could be:
          - a relative or absolute path to a local folder (e.g. ".")
          - a URL to a .tar.gz archive
          - a github URL to a git repo with a branch or commit tag

FLAGS
  -m, --manifest=<manifest_path>  [default: squid.yaml] Specify the relative local path
                                  to a squid manifest file in the squid working directory
      --add-tag=<value>           Add a tag to the deployed squid
      --allow-manifest-override   Allow overriding the manifest during deployment
      --allow-tag-reassign        Allow reassigning an existing tag
      --allow-update              Allow updating an existing squid
      --hard-reset                Perform a hard reset before deploying. This will drop
                                  and re-create all squid resources, including the
                                  database, causing a short API downtime
      --[no-]interactive          Disable interactive mode
      --[no-]stream-logs          Attach and stream squid logs after the deployment

SQUID FLAGS
  -n, --name=<name>                               Name of the squid
  -r, --reference=[<org>/]<name>(@<slot>|:<tag>)  Fully qualified reference of the squid.
                                                  It can include the organization, name,
                                                  slot, or tag
  -s, --slot=<slot>                               Slot of the squid
  -t, --tag=<tag>                                 Tag of the squid

ORG FLAGS
  -o, --org=<code>  Code of the organization

DESCRIPTION
  Deploy new or update an existing squid in the Cloud

EXAMPLES

  // Create a new squid with name provided in the manifest file
  $ sqd deploy .

  // Create a new squid deployment and override it's name to "my-squid-override"
  $ sqd deploy . -n my-squid-override

  // Update the "my-squid" squid with slot "asmzf5"
  $ sqd deploy . -n my-squid -s asmzf5

  // Use a manifest file located in ./path-to-the-squid/squid.prod.yaml
  $ sqd deploy ./path-to-the-squid -m squid.prod.yaml

  // Full paths are also fine
  $ sqd deploy /Users/dev/path-to-the-squid -m /Users/dev/path-to-the-squid/squid.prod.yaml
```

<Warning>
  `--hard-reset` drops and recreates all resources for the selected deployment, including its database.
</Warning>

*See code: [src/commands/deploy.ts](https://github.com/subsquid/squid-cli/blob/master/src/commands/deploy.ts)*


## Related topics

- [Commands Configuration](/en/cloud/reference/cli/commands-json.md)
- [Explorer Command](/en/cloud/reference/cli/explorer.md)
- [Deployment manifest](/en/cloud/reference/manifest.md)
- [Changelog: slots and tags](/en/cloud/reference/deployments-two-changelog.md)
- [Deployment Guide](/en/cloud/deployment-guide.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.