# Deploy

Source: https://openpanel.sh/docs/deploy

Deploy a service from a container image or a Git repository onto your servers, follow the rollout, and roll it back.

A deploy rolls a [service](/docs/concepts/services) out onto the servers it may run on, with its settings and variables as they are at that moment. Each deploy is a [deployment](/docs/concepts/deployments), kept in the service's history.

Everything on these pages works from the console, the [CLI](/docs/cli), the [API](/docs/api) and [MCP](/docs/ai).

## Where a service comes from [#where-a-service-comes-from]

| Source | What a deploy does | Guide |
|---|---|---|
| **A container image** | Your servers pull the image and start it. The deployment starts at `deploying`. | [Deploy an image](/docs/deploy/images) |
| **A Git repository** | One of your servers clones the repository and builds an image, with your Dockerfile or with Railpack, then your servers start it. The deployment starts at `queued`. | [Deploy from Git](/docs/deploy/git) |
| **A template** | In the console, a template from the catalogue becomes ordinary image services, such as an app and its database, which deploy like any image. | [Deploy a template](/docs/deploy/templates) |

## Deploy a service [#deploy-a-service]

The service needs at least one server to run on. Then:

<Tabs items={["Console","CLI","API"]}>
<Tab value="Console">
Open the project and click the service on the canvas. On its **Overview** tab, click **Deploy**. The **Deployments** tab then shows the new deployment and its state as it moves. A new service can also deploy at once: leave **Deploy after creating** ticked in **New service**.
</Tab>

<Tab value="CLI">
```sh
openpanel deploy web --project shop --wait
```

`--wait` follows the deployment until it runs or fails, and exits with `1` if it fails. Without it, the command returns at once.
</Tab>

<Tab value="API">
```sh
curl -X POST "https://openpanel.sh/api/v1/services/$SERVICE_ID/deployments" \
  -H "Authorization: Bearer $OPENPANEL_TOKEN"
```

The answer is the new deployment, with its `id` and `status`. Read it again with `GET /deployments/{id}` until its status is `running` or `failed`. See [Deploy a service](/docs/api/deployments/deploy-a-service).
</Tab>
</Tabs>

You need **deploy** access to the project. See [Per-project access](/docs/members/per-project-access).

## Follow a deployment [#follow-a-deployment]

In the console, the service's **Deployments** tab lists its deployments, newest first, each with its state; click one for its image or commit and the servers it runs on. From the CLI and the API:

| | CLI | API |
|---|---|---|
| A service's deployments, newest first | `openpanel deployments web` | `GET /services/{id}/deployments` |
| One deployment | `openpanel deployments get <id>` | `GET /deployments/{id}` |
| The build's output and what the servers reported: image pulled, container started, healthy | `openpanel logs --deployment <id>` | `GET /deployments/{id}/logs` |
| The same reports, one event each | | `GET /deployments/{id}/events` |
| What the running containers print | `openpanel logs web` | `GET /services/{id}/logs` |

The console does not show logs yet: a service's **Logs** tab says **Not available yet**. See [Build and deploy logs](/docs/monitoring/build-logs) and [Service logs](/docs/monitoring/logs).

## In this section [#in-this-section]

<Cards>
<Card href="/docs/deploy/images" title="Deploy an image" description="Run a public image from Docker Hub or another registry." />

<Card href="/docs/deploy/git" title="Deploy from Git" description="Build a repository's branch or commit on your own server." />

<Card href="/docs/deploy/templates" title="Deploy a template" description="An app and its database from the catalogue, as ordinary services." />

<Card href="/docs/deploy/push-to-deploy" title="Push to deploy" description="Deploy on every push, with a webhook per service." />

<Card href="/docs/deploy/rollbacks" title="Rollbacks and history" description="Run an earlier deployment's image again." />

<Card href="/docs/deploy/ci" title="Deploy from CI" description="Deploy from GitHub Actions or GitLab CI with an API key." />

<Card href="/docs/builds" title="How builds work" description="Dockerfile or Railpack, on the server that runs the service." />
</Cards>