Appearance
Deploy to AWS
One EC2 instance runs the gateway in Docker behind Caddy with automatic HTTPS. Data and WhatsApp logins live in PostgreSQL, so the instance is disposable. deploy/aws/deploy.sh does the work. You need the AWS CLI signed in (aws login) and Docker installed locally.
bash
deploy/aws/deploy.sh bootstrap # once: ECR, IAM role, security group, SSM secrets, Elastic IP, instance
deploy/aws/deploy.sh release # later: build, push and roll the instance onto the new image
deploy/aws/deploy.sh autostart on # start the WhatsApp clients
deploy/aws/deploy.sh status | logs [n] | params | destroyDetails
- Region and size.
us-east-2andt3.smallby default (2 GB plus 2 GB swap). Override withAWS_REGIONandINSTANCE_TYPE.c7i-flex.largehas 4 GB for more numbers. - Secrets are copied from
.envto SSM Parameter Store as SecureString and written to the server at start. They are never in the image.ADMIN_API_KEYis not sent. After changing.env, runrelease, orparamsandautostart on. - Address.
https://<elastic-ip>.sslip.iountil you set your own. Point a DNSArecord at the Elastic IP, runaws ssm put-parameter --name /wa-gateway/site_address --value app.example.com --overwrite, thenrelease. - First boot uses
AUTOSTART_CLIENTS=0. Stop any other server using the database, thenautostart on. Releases stop the old container first so it can save sessions. - Access. Port 22 is closed. Use
aws ssm start-session --target <instance-id>ordeploy/aws/deploy.sh logs. - Use a separate database for local development, never the production one.