GitHub webhooks push repository events to this service in real time. On EC2 you have a real public IP — no tunnel needed.
- Instance: Ubuntu 22.04+, t3.micro or larger
- Security Group — inbound rules:
Port Protocol Source Purpose 22 TCP Your IP SSH 8080 TCP 0.0.0.0/0 App (HTTP) - Install Docker + Compose:
curl -fsSL https://get.docker.com | sh sudo usermod -aG docker ubuntu sudo apt-get install -y docker-compose-plugin newgrp docker
# Clone / copy project to EC2
scp -r ./github-integration ubuntu@<EC2-PUBLIC-IP>:~/github-integration
# SSH in
ssh ubuntu@<EC2-PUBLIC-IP>
cd ~/github-integrationReplace all localhost references with your EC2 public IP or DNS:
server:
port: 8080
github:
oauth_redirect_url: http://<EC2-PUBLIC-IP>:8080/ # frontend landing page
webhook:
app_url: http://<EC2-PUBLIC-IP>:8080
secret: your-shared-webhook-secret # pick any string
internal:
service_key: your-internal-service-keyUse Elastic IP in AWS for a stable address that won't change on restart.
In your GitHub OAuth App settings (github.com → Settings → Developer settings → OAuth Apps):
- Homepage URL:
http://<EC2-PUBLIC-IP>:8080 - Authorization callback URL:
http://<EC2-PUBLIC-IP>:8080/
cd ~/github-integration
make up # starts postgres, redis, rabbitmq, app
make migrate # run DB migrations
make logs # tail logs- Open the target repository → Settings → Webhooks → Add webhook
- Payload URL:
http://<EC2-PUBLIC-IP>:8080/api/webhooks/github - Content type:
application/json - Secret: same value as
webhook.secretin config.yaml - Events: ✅ Pull requests only
- Save
- GitHub → repo Settings → Webhooks → Recent Deliveries → expect
202 Accepted - On EC2:
make logs→ look for:level=INFO msg="webhook received" event=pull_request action=opened level=INFO msg="email notification" to=user@example.com subject="PR #1 opened: ..." - Use Redeliver button in GitHub webhook UI to replay an event without creating a new PR.
- No real email is sent — notifications are logged to stdout (check
make logs) - Webhook registration is per-repo and manual
- To wipe all data and start fresh:
make down-clean && make up && make migrate