Multi-EC2 instances, Mongodb Atlas backend, oh my…

Solid, production-grade WireGuard-only Pritunl architecture.
✅ Architecture Summary
- VPN: WireGuard only — no TLS certs needed per EC2
- WebUI: Exposed via ALB (with HTTPS termination + sticky sessions via client IP)
- Cert: ACM cert attached to ALB (
beta.vpn.example.com) - VPN Traffic: Direct to EC2 instances via Elastic IPs
- MongoDB Atlas: Single backend, all Pritunl instances sync state via Atlas
🧩 WebSockets in Pritunl
Does Pritunl use WebSockets?
Pritunl’s WebUI and admin console do not require WebSockets for core functionality, but:
Pritunl can use WebSockets for:
- Real-time updates on connected users
- Live status/dashboard stats
- Possibly real-time logging updates or session state
ALB Compatibility:
- ALB supports WebSockets natively on HTTPS (TCP upgrade to WS/WSS)
- NLB does not support Layer 7 protocols like WebSockets
🔎 Conclusion: ALB. WebSocket support is included implicitly — no extra setup is needed if Pritunl uses them.
✅ Finalized Refined Design
| |
🛡 Security Considerations
| Area | Recommendation |
|---|---|
| MongoDB Atlas | Use VPC peering or strict IP allowlist (only Pritunl EC2s) |
| Security Groups | Allow only: - 51820/UDP from Internet (VPN) - 443/TCP from ALB (WebUI) - 443/TCP from EC2s to MongoDB Atlas IPs |
| IAM | Lock down SSM / EC2 metadata access; no IAM required unless pulling secrets or certs |
| Health Checks | ALB health check should hit https://<instance-ip>:443 or /ping if available on Pritunl |
✅ TL;DR
| Component | Value |
|---|---|
| VPN Protocol | WireGuard only (no TLS required) |
| WebUI Load Balancer | ALB (HTTPS termination, sticky IP) |
| ACM Cert Location | On ALB |
| Public IPs | Use Elastic IPs per EC2 |
| MongoDB | Atlas (single instance, multi-node if HA) |
| WebSockets | Supported on ALB, optional in Pritunl |
—doug



