> ## 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 RedwoodJS to AWS

> Deploy a RedwoodJS application to your AWS account on ECS Fargate behind an Application Load Balancer with PostgreSQL on RDS through Ravion.

Run RedwoodJS on ECS Fargate behind an Application Load Balancer with PostgreSQL on RDS.

## 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 RedwoodJS 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/redwood](https://www.ravion.com/docs/deploy/aws/redwood) as the framework-specific source of truth.
  3. Confirm this repository contains RedwoodJS and locate the workspace root in a monorepo.
  4. Inspect `package.json`, Redwood config, Prisma schema, and scripts to detect the real build/start commands, web port, health route, and migration steps.
  5. Generate `ravion.yaml` with `rvn-aws-network` + `rvn-ecs-cluster` + `rvn-ecs-web` + `rvn-rds`, using Secrets Manager for the database connection rather than inventing RDS output references.
  6. Ask the user for AWS account IDs, repository slugs, project IDs, ports, or database credentials before proceeding; do not guess.
</Prompt>

## Configure the deployment

Ravion provisions the VPC, cluster, web service, and database in your AWS account.

This example uses [Railpack](https://railpack.com) for the build. Use `build_source: dockerfile` instead when you need a custom Dockerfile.

Build the Redwood API and web sides with `yarn rw build`. Redwood's production server command depends on the generated deployment target; use the start command from your Redwood version's deployment documentation.

```yaml ravion.yaml theme={null}
project:
  givenId: redwood-app
  name: RedwoodJS 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: redwood-production
      - givenId: database
        name: PostgreSQL
        type: rvn-rds
        version: 1.0.0
        input:
          network:
            moduleGivenIdRef: network
          name: redwood-production
          db_name: redwood
          username: redwoodadmin
          engine_major_version: "15"
      - givenId: cluster
        name: ECS cluster
        type: rvn-ecs-cluster
        version: 1.0.0
        input:
          network:
            moduleGivenIdRef: network
          name: redwood-production
      - givenId: web
        name: Redwood web service
        type: rvn-ecs-web
        version: 1.0.0
        input:
          cluster:
            moduleGivenIdRef: cluster
          name: redwood-production-web
          build_source: railpack
          source_repo: my-org/my-redwood-app
          railpack_build_cmd: yarn rw build
          railpack_start_cmd: yarn rw serve
          container_port: 8910
          fargate_size:
            vcpu: 1
            memory_gb: 2
```

Provide the RDS connection as `DATABASE_URL` and Redwood's required runtime settings through Secrets Manager. The module schema does not automatically wire RDS outputs into ECS secrets; create the secret from the database outputs before applying the service.

## Apply and connect your domain

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

Configure the ALB hostname with [custom domains](/guides/custom-domains).

## 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>
