On-Premise Installation
Full installation runbook for deploying Claro on your own infrastructure.
On-Premise Installation
This guide covers deploying Claro on your own infrastructure using Docker Compose. All data stays within your network, which suits regulated industries and organizations with strict data residency requirements.
System Requirements
| Component | Minimum | Recommended |
|---|---|---|
| Operating System | Ubuntu 22.04 LTS | Ubuntu 22.04 LTS or 24.04 LTS |
| CPU | 4 vCPU | 8 vCPU |
| RAM | 8 GB | 16 GB |
| Disk | 50 GB SSD | 100 GB SSD |
| Docker | Docker Engine 24+ | Latest stable |
| Docker Compose | v2.x | Latest stable |
Additional Requirements
- A registered domain name pointed to your server's IP address
- SMTP credentials for sending emails (your own mail server or a transactional email provider)
- An SSL/TLS certificate for HTTPS (or use Let's Encrypt for automatic provisioning)
- Outbound network access on ports 25/587 (SMTP) and 443 (HTTPS)
Installation
Download Claro
Download the latest release archive or clone the repository:
git clone https://github.com/alphacode/claro.git
cd claroAlternatively, download the release archive from the releases page and extract it.
Configure Environment
Copy the example environment file and open it for editing:
cp .env.example .envGenerate the required secrets. Each secret must be a 64-character hexadecimal string:
# Generate JWT secrets
openssl rand -hex 32 # Use output for JWT_SECRET
openssl rand -hex 32 # Use output for JWT_REFRESH_SECRET
# Generate encryption keys
openssl rand -hex 32 # Use output for MASTER_KEK
openssl rand -hex 32 # Use output for BLIND_INDEX_KEYThe MASTER_KEK and BLIND_INDEX_KEY must be different from each other and from the JWT secrets. Store these values securely. If you lose the MASTER_KEK, all encrypted data (user emails, SMTP passwords) becomes permanently unreadable.
Edit the .env file with your configuration:
# Core
NODE_ENV=production
APP_URL=https://claro.yourcompany.com
API_URL=https://claro.yourcompany.com/api
# Database (uses Docker Compose internal network)
DATABASE_URL=postgresql://claro:YOUR_DB_PASSWORD@postgres:5432/claro
# Redis (uses Docker Compose internal network)
REDIS_URL=redis://redis:6379
# JWT - paste the generated values
JWT_SECRET=YOUR_64_CHAR_HEX_SECRET
JWT_REFRESH_SECRET=YOUR_64_CHAR_HEX_SECRET
JWT_ACCESS_EXPIRES_IN=15m
JWT_REFRESH_EXPIRES_IN=7d
# Encryption - paste the generated values
MASTER_KEK=YOUR_64_CHAR_HEX_KEY
BLIND_INDEX_KEY=YOUR_64_CHAR_HEX_KEY
KEY_PROVIDER=env
# SMTP - your email sending credentials
# (configure after deployment via the admin UI, or set defaults here)
# Object storage (S3-compatible - bundled SeaweedFS on the Docker Compose network)
S3_ENDPOINT=http://seaweedfs:8333
S3_ACCESS_KEY=CHANGE_THIS_ACCESS_KEY
S3_SECRET_KEY=CHANGE_THIS_SECRET_KEY
S3_BUCKET=claro-uploads
S3_PUBLIC_ENDPOINT=https://assets.yourcompany.com
# Generate once per deployment: openssl rand -hex 32
SEAWEEDFS_JWT_SIGNING_KEY=CHANGE_THIS_TO_A_RANDOM_HEX_STRING
# Tracking
TRACKING_BASE_URL=https://claro.yourcompany.com/api
# Misc
SWAGGER_ENABLED=falseAny S3-compatible endpoint (Ceph RGW, NetApp StorageGRID, ...) can replace the bundled SeaweedFS by setting S3_ENDPOINT, S3_ACCESS_KEY, S3_SECRET_KEY, and S3_BUCKET.
Start Services
Launch all services using Docker Compose:
docker compose -f docker-compose.prod.yml up -dThis starts the following containers:
- api - NestJS backend (port 3001)
- web - Next.js frontend (port 3000)
- postgres - PostgreSQL 15 database
- redis - Redis 7 for caching and job queues
- seaweedfs - SeaweedFS S3-compatible object storage for file uploads
- worker - BullMQ job processor for email sending and background tasks
Wait for Health Checks
Verify that all services are running and healthy:
# Check container status
docker compose -f docker-compose.prod.yml ps
# Check API health endpoint
curl http://localhost:3001/api/healthThe health endpoint should return a 200 response with service status. The API container automatically runs database migrations on startup.
Run Database Seed
Create the initial tenant and admin user:
docker compose -f docker-compose.prod.yml exec api pnpm run seedThe seed command creates:
- A default tenant with the name you configured
- A Super Admin user with the email and password you specified
Record the admin credentials from the seed output. You will use these to log in for the first time.
Configure Reverse Proxy and SSL
Set up a reverse proxy (Nginx or Caddy) to handle HTTPS termination and route traffic to the Claro containers.
Example Nginx configuration:
server {
listen 443 ssl http2;
server_name claro.yourcompany.com;
ssl_certificate /etc/ssl/certs/claro.crt;
ssl_certificate_key /etc/ssl/private/claro.key;
# Frontend
location / {
proxy_pass http://localhost:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
# API
location /api/ {
proxy_pass http://localhost:3001/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}For automatic SSL with Let's Encrypt, use Certbot:
sudo apt install certbot python3-certbot-nginx
sudo certbot --nginx -d claro.yourcompany.comAccess Claro
Open your browser and navigate to https://claro.yourcompany.com. Log in with the Super Admin credentials from the seed step.
After logging in:
- Create your organization's tenant (if not created by the seed)
- Configure branding (logo, colors)
- Add your first sending domain
- Import users
Follow the Quick Start guide to run your first campaign.
DNS Configuration
Configure the following DNS records for your server:
| Record Type | Name | Value | Purpose |
|---|---|---|---|
| A | claro.yourcompany.com | Your server's public IP | Main application access |
| PTR | (reverse DNS) | claro.yourcompany.com | Email deliverability |
For sending domain DNS configuration (SPF, DKIM, DMARC), see the SMTP & Domain Setup guide.
Firewall Rules
Ensure the following ports are accessible:
| Port | Direction | Protocol | Purpose |
|---|---|---|---|
| 80 | Inbound | TCP | HTTP (redirect to HTTPS) |
| 443 | Inbound | TCP | HTTPS (web application) |
| 25 | Outbound | TCP | SMTP (email sending) |
| 587 | Outbound | TCP | SMTP with STARTTLS (email sending) |
Internal service ports (3000, 3001, 5432, 6379, 9000) should not be exposed to the public internet. They communicate over the Docker Compose internal network.
Verification Checklist
After installation, verify the following:
- All Docker containers are running (
docker compose ps) - API health check returns 200 (
curl https://claro.yourcompany.com/api/health) - You can log in with the admin credentials
- The dashboard loads without errors
- You can navigate to Settings and see the configuration options
- HTTPS is working with a valid certificate (no browser warnings)
Troubleshooting
Containers fail to start: Check Docker logs with docker compose -f docker-compose.prod.yml logs api to identify the specific error. Common issues include missing environment variables or port conflicts.
Database migration errors: The API container runs migrations automatically. If a migration fails, check the API container logs. Ensure the DATABASE_URL is correct and the PostgreSQL container is healthy.
Cannot send emails: Verify your SMTP credentials and ensure outbound ports 25/587 are not blocked by your firewall or hosting provider. Many cloud providers block port 25 by default.
Application is slow: Check resource utilization with docker stats. If the server is resource-constrained, consider upgrading to the recommended specifications (8 vCPU, 16 GB RAM).