Deploying Rebase on AWS
Amazon Web Services (AWS) provides incredible scale and enterprise-grade security. For a production Rebase deployment, we recommend decoupling the architecture by using Amazon RDS for the PostgreSQL database and AWS App Runner (or ECS Fargate) to serve the Node.js backend.
To maintain strict European data compliance, ensure you operate entirely within an EU region, such as eu-central-1 (Frankfurt), eu-west-1 (Ireland), or eu-west-3 (Paris).
1. Provision Amazon RDS (PostgreSQL)
Section titled “1. Provision Amazon RDS (PostgreSQL)”- Navigate to the RDS console in your selected EU region.
- Click Create database and select Standard create.
- Choose the PostgreSQL engine.
- Under Templates, choose Production or Free tier/Dev depending on your load.
- Create a Master Username (e.g.,
rebase_admin) and securely generate a Master Password. - Under Connectivity, ensure the database is placed within a VPC that your future App Runner instance can securely access (or make it publicly accessible if strictly controlling ingress IP ranges).
- Once provisioned, note the Endpoint endpoint address and assemble your URI:
postgresql://rebase_admin:YOUR_PASSWORD@YOUR_ENDPOINT:5432/postgres
2. Push Image to ECR (Elastic Container Registry)
Section titled “2. Push Image to ECR (Elastic Container Registry)”AWS App Runner pulls directly from ECR. Build your Docker image locally and push it.
- Navigate to Elastic Container Registry and create a new private repository called
rebase-backend. - Grab the push commands provided by AWS in the console (which handle Docker authentication).
- Build your image locally from the root folder:
docker build -t rebase-backend ./backend
- Tag and push it to your newly created ECR repository.
3. Deploy via AWS App Runner
Section titled “3. Deploy via AWS App Runner”App Runner is the simplest way to run containers on AWS without managing orchestrators.
- Navigate to AWS App Runner and click Create service.
- Select Container registry and choose Amazon ECR.
- Browse and select your
rebase-backendimage. - Under Service settings, set the Port to 3001.
- Add the necessary Environment Variables under the configuration tab:
| Key | Value |
|---|---|
DATABASE_URL | Your RDS Connection String |
JWT_SECRET | A secure randomly generated hash (32+ chars) |
NODE_ENV | production |
- (Optional) If your RDS instance is strictly private, configure Custom VPC networking in App Runner so the container can securely talk to the database.
- Click Create & deploy.
AWS will handle TLS termination (providing an https URL out of the box) and spin up the Rebase server.