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.
- The Ravion CLI installed and authenticated. See CLI installation.
my-org/my-app as a placeholder. Replace it with your repository before applying the config.
Set up this Next.js app for Ravion SSR or static hosting.
Configure the deployment
Deploy a Next.js App Router or Pages Router application on ECS Fargate behind an Application Load Balancer. Ravion provisions the network and compute resources in your AWS account. This example uses Railpack for the build. Usebuild_source: dockerfile instead when you need a custom Dockerfile.
Set output: "standalone" in next.config.js or next.config.mjs. Next.js writes a self-contained server to .next/standalone/server.js. Copy public and .next/static into the standalone image as described in the Next.js deployment documentation.
ravion.yaml
HOSTNAME=0.0.0.0 and use the ECS-provided PORT value in the server environment. The default Next.js server port is 3000.
Static export
For a fully static site, setoutput: "export" instead. Next.js writes the export to out, which you can serve from S3 and CloudFront.
ravion.yaml
NEXT_PUBLIC_* values for browser configuration.
Apply and connect your domain
Next steps
Custom domains
Point a domain at your deployed service and manage its certificate.
Project config
Preview and apply Ravion configuration from source control.
Pipelines
Add approvals, migrations, and deployment automation.
Logs and metrics
Inspect deploy output and production health in Ravion.