# Cal.com Scheduling Platform

> Open source Calendly alternative for scheduling meetings.

- Category: Productivity & Collaboration
- Difficulty: intermediate
- Components: calcom, postgresql, prisma
- Tags: calcom, scheduling, calendly, meetings, booking
- Source: https://docker.recipes/productivity/cal-scheduling

## Overview

Cal.com is an open-source scheduling infrastructure that serves as a powerful alternative to Calendly, offering complete control over your booking data and workflows. Originally launched as Calendso in 2021, Cal.com has evolved into a comprehensive platform that handles everything from simple appointment booking to complex enterprise scheduling workflows with custom integrations, automated workflows, and white-label solutions. The platform emphasizes privacy, customization, and developer-friendly APIs while maintaining the ease of use that makes scheduling tools effective.

This Docker stack combines Cal.com with PostgreSQL to create a robust, self-hosted scheduling solution that can handle complex booking scenarios and high user loads. PostgreSQL provides the advanced relational database capabilities needed for Cal.com's sophisticated event management, user relationships, and integration data, while supporting the JSON operations required for flexible configuration storage. The combination leverages Prisma as the ORM layer, enabling type-safe database operations and automated migrations that keep your scheduling data consistent as Cal.com evolves.

This configuration is ideal for organizations that need enterprise-grade scheduling capabilities without vendor lock-in, developers building custom booking experiences, and privacy-conscious teams that want to maintain control over their scheduling data. The PostgreSQL backend ensures your booking history, user preferences, and integration configurations remain performant and reliable even as your scheduling volume grows, while Cal.com's extensive API surface allows for deep customization and workflow automation.

## Features

- Multi-calendar integration with Google Calendar, Outlook, CalDAV, and Apple Calendar with real-time availability checking
- Advanced booking workflows including round-robin scheduling, collective events, and sequential meeting chains
- Customizable booking forms with conditional fields, file uploads, and payment integration via Stripe
- PostgreSQL-powered analytics and reporting with complex queries across booking patterns and user behavior
- White-label embedding with custom CSS, domain mapping, and API-driven booking widget customization
- Automated workflow triggers including email sequences, webhook notifications, and Zapier integrations
- Enterprise SSO support with SAML, OAuth providers, and custom authentication workflows
- Multi-timezone handling with automatic conversion and conflict detection across global team schedules

## Use cases

- SaaS companies embedding booking functionality directly into their product with custom branding and workflows
- Consulting firms managing complex client scheduling across multiple time zones with automated follow-up sequences
- Healthcare practices requiring HIPAA-compliant scheduling with custom intake forms and patient management integration
- Educational institutions coordinating office hours, admissions interviews, and student services appointments
- Professional services teams needing round-robin lead distribution with CRM integration and conversion tracking
- Event management companies coordinating speaker availability, venue bookings, and multi-stakeholder scheduling
- Remote-first organizations replacing fragmented scheduling tools with a unified, self-hosted booking infrastructure

## Prerequisites

- Minimum 2GB RAM for Cal.com application server and PostgreSQL database with concurrent user support
- Port 3000 available for Cal.com web interface and API endpoints
- Basic understanding of environment variable configuration for authentication secrets and database connections
- Email service provider credentials (SMTP) for booking confirmations and workflow notifications
- SSL certificate and reverse proxy setup for production deployments with calendar integrations
- Calendar provider API credentials (Google, Microsoft) for two-way calendar synchronization

## docker-compose.yml

```yaml
services:
  calcom:
    image: calcom/cal.com:latest
    ports:
      - "3000:3000"
    environment:
      DATABASE_URL: postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}
      NEXTAUTH_SECRET: ${NEXTAUTH_SECRET}
      CALENDSO_ENCRYPTION_KEY: ${ENCRYPTION_KEY}
      NEXT_PUBLIC_WEBAPP_URL: http://localhost:3000
      NEXT_PUBLIC_LICENSE_CONSENT: agree
    depends_on:
      postgres:
        condition: service_healthy
    networks:
      - cal-net
    restart: unless-stopped

  postgres:
    image: postgres:16-alpine
    environment:
      POSTGRES_USER: ${POSTGRES_USER}
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
      POSTGRES_DB: ${POSTGRES_DB}
    volumes:
      - postgres_data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
      interval: 10s
      timeout: 5s
      retries: 5
    networks:
      - cal-net
    restart: unless-stopped

volumes:
  postgres_data:

networks:
  cal-net:
    driver: bridge
```

## .env

```bash
# PostgreSQL
POSTGRES_USER=calcom
POSTGRES_PASSWORD=secure_postgres_password
POSTGRES_DB=calcom

# Cal.com
NEXTAUTH_SECRET=$(openssl rand -hex 32)
ENCRYPTION_KEY=$(openssl rand -hex 32)
```

## Usage notes

- Cal.com at http://localhost:3000
- Create account on first visit
- Connect Google/Outlook calendars
- Embed booking widget on your site

## Troubleshooting

- Database connection failed: Verify POSTGRES_USER and POSTGRES_PASSWORD match between Cal.com and PostgreSQL containers, and ensure postgres container is healthy before Cal.com starts
- Calendar integration failing: Check that NEXT_PUBLIC_WEBAPP_URL matches your actual domain and that OAuth callbacks are configured correctly in your calendar provider's API console
- Booking confirmations not sending: Verify SMTP credentials in Cal.com environment variables and ensure your email provider allows connections from Docker container IP ranges
- Prisma migration errors on startup: Clear the postgres_data volume if switching between Cal.com versions, as schema changes may require a fresh database initialization
- Session authentication issues: Regenerate NEXTAUTH_SECRET and CALENDSO_ENCRYPTION_KEY with sufficient entropy (32+ character random strings) and restart all containers
- Performance issues with large booking volumes: Increase PostgreSQL shared_buffers and work_mem settings, and consider adding database connection pooling for high-traffic deployments

