> ## Documentation Index
> Fetch the complete documentation index at: https://ravion-b90c0359-mintlify-710044b6.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# How to deploy Backstage to AWS

> Deploy a Backstage developer portal on ECS Fargate with PostgreSQL on Amazon RDS in your AWS account through Ravion, with HTTPS, custom domains, and CI/CD.

Deploy a Backstage production image to ECS Fargate behind an Application Load Balancer.

## Prerequisites

* A Git repository containing your application and its production build command.
* A Ravion account with your AWS account connected. Start free at [Ravion signup](https://app.ravion.com/signup).
* The Ravion CLI installed and authenticated. See [CLI installation](/cli/installation).

The examples use `my-org/my-app` as a placeholder. Replace it with your repository before applying the config.

<Prompt description="Set up this Backstage app for Ravion ECS hosting." icon="sparkles" actions={["copy", "cursor"]}>
  1. Before any other action, read and follow [https://www.ravion.com/docs/start-here#agent-workflow](https://www.ravion.com/docs/start-here#agent-workflow) as the mandatory agent workflow.
  2. Use [https://www.ravion.com/docs/deploy/aws/backstage](https://www.ravion.com/docs/deploy/aws/backstage) as the framework-specific source of truth.
  3. Confirm this repository contains Backstage and locate the app root in a monorepo.
  4. Inspect `package.json`, `app-config.*`, the Backstage multi-stage Dockerfile documentation, and repository Docker files to detect the real build/start commands, port, and health path. Do not assume the scaffolded `packages/backend/Dockerfile` can run without a host build.
  5. Generate `ravion.yaml` with `rvn-aws-network` + `rvn-ecs-cluster` + `rvn-ecs-web` + `rvn-rds`, using `build_source: dockerfile` and the repository-root Dockerfile, substituting real AWS, repository, branch, and runtime values. Bind to `0.0.0.0`; create the documented Secrets Manager database step rather than inventing RDS references.
  6. Ask the user for AWS account IDs, repository slugs, project IDs, or database credentials before proceeding; do not guess.
</Prompt>

## Configure the deployment

Ravion creates the VPC, ECS cluster, service, and optional RDS database in your AWS account.

This guide uses a repository Dockerfile instead of [Railpack](https://railpack.com) because the framework-specific image build requires explicit container instructions.

Backstage's production Docker guide documents a host-build variant and a multi-stage variant. Ravion builds from your repository, so use the multi-stage Dockerfile from [Backstage's Docker deployment guide](https://backstage.io/docs/deployment/docker/) at the repository root. The scaffolded `packages/backend/Dockerfile` is the host-build variant: it expects `yarn install`, `yarn tsc`, and `yarn build:backend` to run before `docker build`, so it does not work unmodified with Ravion. Backstage also documents different `.dockerignore` requirements for the two variants. The container listens on port 7007.

```yaml ravion.yaml theme={null}
project:
  givenId: backstage-app
  name: Backstage app
environments:
  - givenId: production
    name: Production
    moduleInstances:
      - givenId: network
        name: Network
        type: rvn-aws-network
        version: 1.0.0
        input:
          aws_account_id: ravion-prod
          aws_region: us-east-1
          name: backstage-production
      - givenId: database
        name: PostgreSQL
        type: rvn-rds
        version: 1.0.0
        input:
          network:
            moduleGivenIdRef: network
          name: backstage-production
          db_name: backstage
          username: backstageadmin
          engine_major_version: "15"
      - givenId: cluster
        name: ECS cluster
        type: rvn-ecs-cluster
        version: 1.0.0
        input:
          network:
            moduleGivenIdRef: network
          name: backstage-production
      - givenId: web
        name: Backstage web service
        type: rvn-ecs-web
        version: 1.0.0
        input:
          cluster:
            moduleGivenIdRef: cluster
          name: backstage-production-web
          build_source: dockerfile
          source_repo: my-org/my-backstage-app
          dockerfile: Dockerfile
          container_port: 7007
          fargate_size:
            vcpu: 1
            memory_gb: 2
```

Set the Backstage database connection and integration credentials through Secrets Manager. The current module definitions support ECS runtime secrets but do not automatically connect `rvn-rds` outputs to a secret, so create the secret after reading the RDS outputs.

## Apply and connect your domain

```bash theme={null}
ravion project create --given-id backstage-app --name "Backstage app"
ravion project config apply backstage-app --file ravion.yaml --dry-run
ravion project config apply backstage-app --file ravion.yaml
```

Use [custom domains](/guides/custom-domains) to configure the ALB hostname and certificate.

## Next steps

<CardGroup cols={2}>
  <Card title="Custom domains" icon="globe" href="/guides/custom-domains">
    Point a domain at your deployed service and manage its certificate.
  </Card>

  <Card title="Project config" icon="file-code" href="/config-as-code/project-config-file">
    Preview and apply Ravion configuration from source control.
  </Card>

  <Card title="Pipelines" icon="arrow-progress" href="/config-as-code/pipeline-config-file">
    Add approvals, migrations, and deployment automation.
  </Card>

  <Card title="Logs and metrics" icon="chart-line" href="/modules/logs">
    Inspect deploy output and production health in Ravion.
  </Card>
</CardGroup>
