Skip to main content
This guide covers Docker-specific configuration, customization, and best practices for deploying Cal.com with Docker and Docker Compose.

Overview

Cal.com provides official Docker images and Docker Compose configurations for easy deployment:
  • Docker Hub: calcom/cal.com
  • Scarf Registry: calcom.docker.scarf.sh/calcom/cal.com (default, for metrics)
  • GitHub: Source Dockerfiles in the main repository
Support Policy: Cal.com maintains official Docker configurations, but users are responsible for their Docker-based installations. Community support is available via GitHub Discussions.

Docker Compose Services

The default docker-compose.yml includes multiple services:

Service Architecture

Database Service

Change default credentials in production!

Redis Service

Redis is used for:
  • Caching
  • Job queues
  • Session storage
  • Rate limiting

Cal.com Web Service

API v2 Service

Prisma Studio (Development)

Remove or comment out Prisma Studio in production to prevent unauthorized database access.

Dockerfile Deep Dive

Main Application Dockerfile

The Cal.com Dockerfile uses multi-stage builds:

Stage 1: Builder

NEXT_PUBLIC_WEBAPP_URL is set to a placeholder during build and replaced at runtime by start.sh script.

Stage 2: Builder-Two

Stage 3: Runner

API v2 Dockerfile

Environment Variables

Runtime Variables

These must be set in your .env file:

Build-time Arguments

For custom builds, pass these arguments:

Startup Process

The scripts/start.sh handles initialization:

Initialization Steps

  1. URL Replacement: Updates static files if NEXT_PUBLIC_WEBAPP_URL changed
  2. Database Wait: Ensures PostgreSQL is ready
  3. Migrations: Applies pending database migrations
  4. App Store Seed: Syncs app metadata
  5. Application Start: Launches Next.js server
Migrations run automatically on every container start. This is safe and idempotent.

Docker Compose Usage

Running Services

Updating Images

Scaling Services

Custom Docker Builds

Building from Source

DOCKER_BUILDKIT=0 is required to enable network bridge during build. This limitation may be removed in future versions.

Custom Dockerfile

Create a custom Dockerfile extending the base image:

Multi-platform Builds

ARM Architecture

ARM Images

For Apple Silicon, Raspberry Pi, and ARM servers:

Building for ARM

Volumes and Persistence

Default Volumes

Backup Volumes

Inspect Volumes

Networks

Default Network

All services communicate on the stack network.

Custom Networks

Health Checks

Built-in Health Check

The Dockerfile includes automatic health monitoring:

Custom Health Checks

Check Health Status

Production Optimizations

Resource Limits

Restart Policies

Logging Configuration

Read-only Root Filesystem

Troubleshooting

View Logs

Container Shell Access

Database Connection Issues

Port Conflicts

Solution: Change port mapping:

Out of Memory

Solution: Increase memory:

Migration Failures

Security Best Practices

Secret Management

Non-root User

Modify Dockerfile to run as non-root:

Network Isolation

Remove Development Tools

Monitoring and Observability

Prometheus Metrics

Expose metrics endpoint:

Container Stats

Production Checklist

  • Change default database credentials
  • Generate strong secrets (NEXTAUTH_SECRET, CALENDSO_ENCRYPTION_KEY)
  • Generate VAPID keys for push notifications
  • Remove or secure Prisma Studio service
  • Configure proper NEXT_PUBLIC_WEBAPP_URL
  • Set up external database or configure backups
  • Configure Redis persistence
  • Set resource limits and restart policies
  • Configure logging rotation
  • Enable health checks
  • Use secrets management (not .env file)
  • Set up reverse proxy (Nginx, Traefik, Caddy)
  • Configure SSL certificates
  • Test backup and restore procedures
  • Monitor container health and logs
  • Document custom configurations

Next Steps