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

# Deployments and rollbacks

> See every build of a project, redeploy or rebuild a commit, roll back to an earlier version, and cancel a build that's running.

A deployment is one build of your project, from one commit or image, and the running version it produces. Pxxl keeps the list so you can see what changed, go back to a version that worked, or build a commit again.

Open a project, then **Deployments**.

![The Deployments tab listing four builds with their commit, branch and build time, with the row menu open showing View logs, View repo, Rebuild same commit, Rollback and Copy deployment ID.](https://mintcdn.com/pxxl/hPMZlEjpo8tX12E4/images/projects/project-deployments-menu.jpeg?fit=max\&auto=format\&n=hPMZlEjpo8tX12E4\&q=85\&s=b053b9d03eb8ed20a8f481bdb515ff7f)

## What a row shows

| Part | Meaning |
| - | - |
| Status icon | The deployment's state (see below). |
| Title | The commit message. |
| Short SHA and branch | The commit that was built. |
| Who | The GitHub user who pushed, or **Manual Deployment** for a redeploy from the dashboard, CLI or API. |
| Date and time | When the deployment started. |
| Build time | How long the build took, such as **(35s) Build**, or **Queued**. |
| **Replaced** | A newer deployment took over from this one. |
| **Artifact expired** | The stored build is gone, so this version can't be rolled back to. |

## Statuses

| Status | Meaning |
| - | - |
| **Queued** | Waiting for a build slot. |
| **Waiting for CI** | Waiting for the commit's GitHub checks to pass. See [Wait for CI](https://docs.pxxl.app/projects/settings.md#build). |
| **Building** | Installing dependencies and building. |
| **Pending** | Built, starting and passing its health check. |
| **Live** | The version serving traffic now. Earlier successful deployments show **Deployed**. |
| **Replaced** | Was live, then a newer deployment took over. |
| **Failed** | The build, the start or the health check failed. The previous version kept serving. |
| **Cancelled** | Stopped by you or by the build time limit. |

Click a deployment, or choose **View logs**, to read its build log. Runtime output is in **Live Logs**.

## Actions on a deployment

Open the **⋮** menu at the end of a row:

| Action | What it does |
| - | - |
| **View logs** | Opens the deployment's build and deploy log. |
| **View repo** | Opens the repository on GitHub. |
| **Rebuild same commit** | Builds that exact commit again, on its original branch. Use it after changing a variable or a build setting. |
| **Rollback** | Puts this version back live without building. See [Roll back](#roll-back). |
| **Cancel deployment** | Stops a deployment that's queued, building or waiting for CI. Only shown while it's in progress. |
| **Copy deployment ID** | Copies the ID for the CLI, API or support. |

## Redeploy

**Redeploy** in the project header builds the project again.

* Pick the **latest commit** of the deployed branch, or choose an earlier commit.
* Turn **Use build cache** off to build from scratch, for example when a dependency cache seems stale.

A redeploy also starts a project that was paused or stopped.

```bash theme={null}
pxxl redeploy <project-id>
```

## Roll back

A rollback puts an earlier deployment back live in seconds. Pxxl runs the build it stored for that deployment, so nothing is rebuilt.

**1. Find the version**

Open **Deployments** and find the deployment that worked. Check its commit and date.

**2. Choose Rollback**

Open its **⋮** menu and choose **Rollback**. Confirm.

**3. Check it's live**

The deployment becomes **Live** once it passes its health check. The one you left shows **Replaced**.

What a rollback restores, and what it doesn't:

| Restored | Not restored |
| - | - |
| The built code or image of that deployment. | Environment variables. The rollback runs with the project's **current** variables. To undo a variable change, use the variable history on the **Secrets** tab. |
| The deployment's build settings. | Domains and edge settings. They stay as they are now. |
| | The [pre-deploy command](https://docs.pxxl.app/projects/settings.md#build). Rollbacks skip it, so migrations don't run again. |

Limits:

* Rollbacks are on **Plus**, **Pro** and **Enterprise**.
* The project must be active, not archived or paused.
* **Rollback** is hidden on the version that's already live, and on deployments marked **Artifact expired**. Stored builds are kept for a limited time, so very old deployments can't be rolled back to. Rebuild the commit instead.

> [!NOTE]
>
> A rollback isn't permanent. The next push to the branch deploys as usual. To stay on the older version, turn off **Auto-deploy** in [Settings > Deployments](https://docs.pxxl.app/projects/settings.md#deployments) first.

## Build time limit

A build that runs for more than **30 minutes** is cancelled with "build exceeded 30 minute timeout". The current version keeps serving. Speed up a slow build with the build cache, a smaller install, or [watch paths](https://docs.pxxl.app/projects/settings.md#build) so unrelated pushes don't build at all.

## From the CLI

```bash theme={null}
pxxl deployments list --project <project-id>   # recent deployments
pxxl deployments get <deployment-id>           # one deployment's details
pxxl logs --deployment <deployment-id>         # its log
pxxl redeploy <project-id>                     # build again
```

## From the API

| Method | Path | What it does |
| - | - | - |
| `POST` | `/api/v3/projects/:id/redeploy` | Redeploy. Optional `commitSha` and `useBuildCache`. |
| `POST` | `/api/v3/deployments/:id/rebuild` | Rebuild the same commit. Send `{"useBuildCache": false}` for a clean build. |
| `POST` | `/api/v3/deployments/:id/rollback` | Roll back to this deployment. Returns `410` when its build has expired. |
| `POST` | `/api/v3/deployments/:id/cancel` | Cancel a queued, building or waiting deployment. |

See [Projects and deployments](https://docs.pxxl.app/integrations/api/projects-deployments.md) for authentication and responses.

## If something goes wrong

> [accordion] The build failed
>
> Open **View logs** and read from the first error, not the last line. Most failures are a missing variable at build time, a wrong build command, or the wrong [base directory](https://docs.pxxl.app/projects/settings.md#git). See [Deployment issues](https://docs.pxxl.app/troubleshooting/deployments.md).

> [accordion] Built fine, but failed to start
>
> The app didn't answer on its port in time. Check that it listens on `0.0.0.0` and on the port in [Settings > General](https://docs.pxxl.app/projects/settings.md#general), and read **Live Logs** for a crash on start.

> [accordion] Rollback isn't in the menu
>
> It's the live version already, its build has expired, or the project's plan is Free.

> [accordion] A push didn't deploy
>
> Check **Auto-deploy**, **Deploy ignore word**, **Watch paths** and **Wait for CI** in [Project settings](https://docs.pxxl.app/projects/settings.md).

## Where to go next

> [card] [Preview deployments](https://docs.pxxl.app/deploy/previews.md)
>
> Deploy every pull request to its own URL.

> [card] [Project settings](https://docs.pxxl.app/projects/settings.md)
>
> Control when pushes deploy.


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