# Triggering a Manual Deploy

> How to deploy your Phoenix app from the dashboard with a single click.

When you deploy, Potions pulls the latest commit from your configured branch, builds a release, and ships it to your server with zero downtime.

## Deploying Your App

1. Navigate to your server and open your app
2. Go to the **Deployments** tab
3. Click the **Deploy** button in the top-right corner

![The Deployments tab showing the Deploy button and deployment history](https://media.potions.io/docs/deployments-tab-deploy-button.png)

When you click **Deploy**, Potions fetches the latest commit from your app's configured branch (e.g., `main`) on GitHub. Whatever commit is at the tip of the branch is deployed.

You can watch the build output in real time by clicking **View Log** on the active deployment.

## What Happens During a Deploy

1. **Queued**: waiting for an available build slot on the server. Only one deploy runs at a time per server.
2. **Building**: Potions uses a dedicated build server to fetch dependencies, compile your code, and build a release. This is where most of the time is spent.
3. **Deploying**: the compiled release is transferred to your server and the new instance is started.
4. **Migrating**: database migrations run against your app's PostgreSQL database.
5. **Verifying**: Potions health-checks the new instance before switching traffic over.

Once everything passes, the status changes to **Succeeded** and your new release is live.

If anything fails at any stage, the deployment is marked as **Failed** and your running app is unaffected. See [Troubleshooting Failed Deploys](/docs/troubleshooting-deploys) for common failure causes.

## Build Logs

Click **View Log** on any deployment to expand the build output. For in-progress deployments, logs stream in real time as the build runs.

![Live build log streaming in the terminal-style log viewer](https://media.potions.io/docs/deploy-build-log-streaming.png)

For completed deployments, full logs are persisted so you can review them after the fact.

## Redeploying a Previous Commit

You can redeploy from a previous commit using the **Redeploy** button. This is useful when: 

- An environment variable change needs a rebuild to take effect
- A transient build failure (network timeout, GitHub rate limit) caused a previous deploy to fail
- You want to rebuild after changing Elixir or Erlang versions

## Rolling Back

If something goes wrong with your latest deploy, you can roll back to the previous release using the **Rollback** button - no full rebuild needed.

Rolling back flips traffic from the current slot back to the previous one. Because both blue and green slots keep their release binaries on disk, the rollback takes effect in seconds rather than minutes. See [Zero-Downtime Deployments](/docs/zero-downtime-deploys) for details on how blue-green slots work.

## Things to Know

- **A deploy waits for the app's database.** When you create an app, Potions sets up its database in the background and the **Deploy** button stays disabled until that's done (usually a few seconds). A deploy that starts in the meantime, for example from a push, waits up to 15 minutes for the database, then builds. If the database still isn't ready, the deploy fails and says why.
- **Builds time out after 15 minutes without output.** A build that prints nothing for 15 minutes fails, which usually means a dependency is hanging. A build that keeps printing output, such as a native library compiling from source, can take longer, up to a 45-minute limit for the whole deploy. See [Build timeout](/docs/troubleshooting-deploys#build-timeout).
