docker.recipes

Cal.com

advanced

Open source scheduling infrastructure.

Overview

Cal.com is an open-source scheduling infrastructure that emerged as a privacy-focused alternative to proprietary booking platforms like Calendly. Built on Next.js and TypeScript, Cal.com provides comprehensive calendar management, appointment booking, and scheduling automation while maintaining full data ownership and customization control. The platform supports multiple calendar integrations, payment processing, team scheduling, and extensive API capabilities for custom workflows. This stack combines Cal.com with PostgreSQL and Prisma ORM to create a robust, self-hosted scheduling solution. PostgreSQL serves as the primary database, handling user data, bookings, availability schedules, and calendar integrations with ACID compliance and strong consistency. Prisma acts as the database toolkit and ORM, providing type-safe database access, automated migrations, and seamless schema management that Cal.com relies on for its complex relational data models. This configuration is ideal for organizations requiring scheduling infrastructure with complete data control, custom branding, and integration flexibility. Businesses can deploy Cal.com privately while leveraging PostgreSQL's enterprise-grade reliability for handling booking data, user authentication, and calendar synchronization. The stack scales from small teams to enterprise deployments, offering API access for custom integrations and webhook support for workflow automation.

Key Features

  • Multi-calendar integration with Google Calendar, Outlook, and CalDAV providers
  • Team scheduling with round-robin, collective, and custom routing algorithms
  • Payment integration with Stripe for paid consultations and booking fees
  • Webhook system for real-time booking notifications and workflow automation
  • REST and GraphQL APIs for custom scheduling applications and integrations
  • Video conferencing auto-setup with Zoom, Google Meet, and Microsoft Teams
  • PostgreSQL ACID compliance ensuring booking data integrity and consistency
  • Prisma type-safe database operations with automated schema migrations

Common Use Cases

  • 1SaaS companies needing white-label scheduling for customer success teams
  • 2Healthcare practices requiring HIPAA-compliant appointment booking systems
  • 3Consulting firms with complex team scheduling and client management needs
  • 4Educational institutions managing office hours and student consultation bookings
  • 5Service businesses integrating scheduling into existing customer portals
  • 6Enterprises requiring scheduling APIs for internal tools and HR systems
  • 7Development agencies building custom scheduling features for client applications

Prerequisites

  • Minimum 2GB RAM for PostgreSQL database and Cal.com application processes
  • Port 3000 available for Cal.com web interface access
  • SSL certificate and domain name for production calendar integrations
  • SMTP server credentials for booking confirmation and notification emails
  • OAuth application credentials for Google, Microsoft, or other calendar providers
  • Basic understanding of Prisma migrations and PostgreSQL administration

For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms

docker-compose.yml

docker-compose.yml
1services:
2 cal:
3 image: calcom/cal.com:latest
4 container_name: calcom
5 restart: unless-stopped
6 ports:
7 - "3000:3000"
8 environment:
9 DATABASE_URL: postgresql://cal:${DB_PASSWORD}@db:5432/cal
10 NEXTAUTH_SECRET: ${NEXTAUTH_SECRET}
11 CALENDSO_ENCRYPTION_KEY: ${ENCRYPTION_KEY}
12 NEXT_PUBLIC_WEBAPP_URL: http://localhost:3000
13 depends_on:
14 - db
15
16 db:
17 image: postgres:15-alpine
18 container_name: calcom-db
19 restart: unless-stopped
20 environment:
21 POSTGRES_USER: cal
22 POSTGRES_PASSWORD: ${DB_PASSWORD}
23 POSTGRES_DB: cal
24 volumes:
25 - calcom_db:/var/lib/postgresql/data
26
27volumes:
28 calcom_db:

.env Template

.env
1DB_PASSWORD=changeme
2NEXTAUTH_SECRET=generate-32-char-secret
3ENCRYPTION_KEY=generate-32-char-key

Usage Notes

  1. 1Docs: https://cal.com/docs
  2. 2Access at http://localhost:3000 - create account on first visit
  3. 3Set availability schedule and event types
  4. 4Integrations: Google Calendar, Outlook, Zoom, Meet, Teams
  5. 5Generate secrets: openssl rand -hex 32
  6. 6Webhooks and API for custom integrations

Individual Services(2 services)

Copy individual services to mix and match with your existing compose files.

cal
cal:
  image: calcom/cal.com:latest
  container_name: calcom
  restart: unless-stopped
  ports:
    - "3000:3000"
  environment:
    DATABASE_URL: postgresql://cal:${DB_PASSWORD}@db:5432/cal
    NEXTAUTH_SECRET: ${NEXTAUTH_SECRET}
    CALENDSO_ENCRYPTION_KEY: ${ENCRYPTION_KEY}
    NEXT_PUBLIC_WEBAPP_URL: http://localhost:3000
  depends_on:
    - db
db
db:
  image: postgres:15-alpine
  container_name: calcom-db
  restart: unless-stopped
  environment:
    POSTGRES_USER: cal
    POSTGRES_PASSWORD: ${DB_PASSWORD}
    POSTGRES_DB: cal
  volumes:
    - calcom_db:/var/lib/postgresql/data

Quick Start

terminal
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 cal:
5 image: calcom/cal.com:latest
6 container_name: calcom
7 restart: unless-stopped
8 ports:
9 - "3000:3000"
10 environment:
11 DATABASE_URL: postgresql://cal:${DB_PASSWORD}@db:5432/cal
12 NEXTAUTH_SECRET: ${NEXTAUTH_SECRET}
13 CALENDSO_ENCRYPTION_KEY: ${ENCRYPTION_KEY}
14 NEXT_PUBLIC_WEBAPP_URL: http://localhost:3000
15 depends_on:
16 - db
17
18 db:
19 image: postgres:15-alpine
20 container_name: calcom-db
21 restart: unless-stopped
22 environment:
23 POSTGRES_USER: cal
24 POSTGRES_PASSWORD: ${DB_PASSWORD}
25 POSTGRES_DB: cal
26 volumes:
27 - calcom_db:/var/lib/postgresql/data
28
29volumes:
30 calcom_db:
31EOF
32
33# 2. Create the .env file
34cat > .env << 'EOF'
35DB_PASSWORD=changeme
36NEXTAUTH_SECRET=generate-32-char-secret
37ENCRYPTION_KEY=generate-32-char-key
38EOF
39
40# 3. Start the services
41docker compose up -d
42
43# 4. View logs
44docker compose logs -f

One-Liner

Run this command to download and set up the recipe in one step:

terminal
1curl -fsSL https://docker.recipes/api/recipes/cal-com/run | bash

Troubleshooting

  • Database connection failed: Verify PostgreSQL container is running and DATABASE_URL environment variable matches database credentials
  • Calendar integration not working: Check OAuth redirect URLs match your NEXT_PUBLIC_WEBAPP_URL and calendar provider settings
  • Prisma migration errors: Run docker exec calcom npx prisma db push to sync database schema with Prisma models
  • NEXTAUTH_SECRET missing error: Generate a 32-character secret with openssl rand -hex 32 and add to environment variables
  • Booking confirmations not sending: Configure SMTP settings in Cal.com admin panel and verify email server connectivity
  • Database performance issues: Increase PostgreSQL shared_buffers and work_mem settings in custom postgres.conf volume mount

Community Notes

Loading...
Loading notes...

Download Recipe Kit

Get all files in a ready-to-deploy package

Includes docker-compose.yml, .env template, README, and license

Ad Space