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

# Deploying Apps

> Learn about the components involved in deploying an Aptible app in seconds: images, services, and configurations

## What's in a Deployment?

On Aptible, developers can deploy code, and in seconds, the platform will transform their code into app containers with zero-downtime — completely abstracting the complexities of the underlying infrastructure.

Apps are made up of three components:

* **[An Image](https://www.aptible.com/docs/core-concepts/apps/deploying-apps/image/overview.md):** Deploy directly from a Docker image, or push your code to Aptible with `git push` and the platform will build a Docker image for you.
* **[Services](https://www.aptible.com/docs/core-concepts/apps/deploying-apps/services.md):** Services define how many containers Aptible will start for your app, what command they will run, and their Memory and CPU Limits.
* **[Configuration](https://www.aptible.com/docs/core-concepts/apps/deploying-apps/configuration.md) (optional):** The configuration is a set of keys and values securely passed to the containers as environment variables. For example - secrets are passed as configurations.

## Deploy Methods

### Deploying with Git

Add a Dockerfile to your repository and push it to Aptible's Git Remote. Aptible builds the image and deploys it for you. See [Deploying with Git](https://www.aptible.com/docs/core-concepts/apps/deploying-apps/image/deploying-with-git/overview.md) for Dockerfile requirements, SSH key setup, and private registry authentication.

### Deploying with Docker Image

Build your image locally or in CI, push it to a registry, and deploy it with `aptible deploy --docker-image`. See [Deploying with Docker Image](https://www.aptible.com/docs/core-concepts/apps/deploying-apps/image/deploying-with-docker-image/overview.md) for registry authentication and FAQs.

> [!NOTE]
>
> The [Aptible Terraform provider](https://www.aptible.com/docs/reference/terraform.md) only supports deploying via Docker Image.

## The Deploy Process

The process is similar regardless of method:

* You define your [Services](https://www.aptible.com/docs/core-concepts/apps/deploying-apps/services.md) and [Configuration](https://www.aptible.com/docs/core-concepts/apps/deploying-apps/configuration.md) (such as environment variables)
* Aptible provisions the underlying infrastructure securely and reliably

For migrations or other commands that need to run before a release goes live, use [`.aptible.yml`](https://www.aptible.com/docs/core-concepts/apps/deploying-apps/releases/aptible-yml) to define `before_deploy` hooks and after-success/after-failure commands.

## Releases & Rollbacks

Every deploy, restart, configure, or scale operation launches a new [Release](https://www.aptible.com/docs/core-concepts/apps/deploying-apps/releases/overview.md) — a new set of Containers for a Service. Services without an Endpoint deploy with zero container overlap by default; Services with an Endpoint get a zero-downtime, load-balancer-driven cutover instead.

If a deployment fails, Aptible supports both:

* **[Automatic rollbacks](https://www.aptible.com/docs/core-concepts/architecture/operations.md#operation-rollbacks)** for when things fail
* **Manual rollbacks** via the [`aptible operation:cancel`](https://www.aptible.com/docs/reference/aptible-cli/cli-commands/cli-operation-cancel) CLI command, to cancel an in-progress operation and revert it

## Deployment Metadata

[Link an App to its Source](https://www.aptible.com/docs/core-concepts/apps/deploying-apps/linking-apps-to-sources.md) to see exactly what's deployed where. Once linked (automatically via the Aptible Deploy GitHub Action, or manually via deployment metadata config vars), the Aptible Dashboard shows the currently-deployed revision and a full deployment history for each App.

## Get Started

If you are just getting started, [deploy a starter template.](https://www.aptible.com/docs/getting-started/deploy-starter-template/overview.md)

## Integrating with CI/CD

Aptible integrates with several continuous integration services to make it easier to deploy on Aptible—whether migrating from another platform or deploying for the first time.

> [card] [Browse CI/CD integrations](https://www.aptible.com/docs/core-concepts/integrations/overview.md#developer-tools)

> [card] [How to deploy to Aptible from CI/CD](https://www.aptible.com/docs/how-to-guides/app-guides/how-to-deploy-aptible-ci-cd.md)
