System Requirements
Before deploying apilens, ensure your infrastructure meets these requirements.Minimum Requirements
Development
- 2 CPU cores
- 4 GB RAM
- 20 GB SSD storage
- Docker 20.10+
Production
- 4+ CPU cores
- 8+ GB RAM
- 100+ GB SSD storage
- Docker 20.10+
Detailed Requirements
Hardware
| Component | Minimum | Recommended | High Volume |
|---|---|---|---|
| CPU | 2 cores | 4 cores | 8+ cores |
| RAM | 4 GB | 8 GB | 16+ GB |
| Storage | 20 GB SSD | 100 GB SSD | 500+ GB NVMe |
| Network | 100 Mbps | 1 Gbps | 10 Gbps |
Software
| Software | Version | Notes |
|---|---|---|
| Docker | 20.10+ | Required |
| Docker Compose | 2.0+ | Required |
| Linux | Ubuntu 20.04+, Debian 11+ | Recommended |
| macOS | 12+ | Development only |
| Windows | WSL2 | Development only |
Ports
Ensure these ports are available:| Port | Service | Required |
|---|---|---|
| 80 | HTTP | Yes |
| 443 | HTTPS | Production |
| 5432 | PostgreSQL | Internal |
| 9000 | ClickHouse (native) | Internal |
| 8123 | ClickHouse (HTTP) | Internal |
| 6379 | Redis | Internal |
Storage Considerations
Data Retention vs Storage
| Data Type | Retention | Storage (1M events/day) |
|---|---|---|
| Metrics | 90 days | ~10 GB/month |
| Logs | 30 days | ~50 GB/month |
| Traces | 30 days | ~30 GB/month |
ClickHouse uses efficient compression. Actual storage usage is typically 5-10x smaller than raw data.
Recommended Storage Layout
Network Requirements
Outbound Access
| Destination | Purpose | Required |
|---|---|---|
| Docker Hub | Pull images | Yes |
| Let’s Encrypt | SSL certificates | Production |
| Auth0 | Authentication | If using Auth0 |
Firewall Rules
Scaling Considerations
When to Scale
| Indicator | Action |
|---|---|
| CPU > 80% sustained | Add more cores or horizontal scale |
| RAM > 85% | Increase memory |
| Disk > 80% | Expand storage or reduce retention |
| Query latency > 5s | Scale ClickHouse |
Horizontal Scaling
For high-volume deployments:- Backend: Run multiple backend containers behind a load balancer
- Celery Workers: Add more worker containers
- ClickHouse: Set up a cluster (advanced)
- PostgreSQL: Use managed service with replicas
Cloud Provider Recommendations
AWS
| Workload | Instance Type | Monthly Cost* |
|---|---|---|
| Small | t3.medium | ~$30 |
| Medium | t3.large | ~$60 |
| Large | c5.xlarge | ~$125 |
DigitalOcean
| Workload | Droplet | Monthly Cost |
|---|---|---|
| Small | s-2vcpu-4gb | $24 |
| Medium | s-4vcpu-8gb | $48 |
| Large | c-4-8gib | $84 |
Hetzner
| Workload | Server | Monthly Cost |
|---|---|---|
| Small | CX21 | €6 |
| Medium | CX31 | €10 |
| Large | CX41 | €16 |
Pre-Installation Checklist
Server meets minimum requirements
Docker and Docker Compose installed
Domain name configured (production)
SSL certificate or Let’s Encrypt access
Firewall configured
Backup strategy planned
Next Steps
Docker Compose Setup
Deploy with Docker Compose
Production Deployment
Production deployment guide