This guide provides a full Ansible playbook to deploy Calcom with Docker Compose on Debian 10+, Ubuntu LTS, and RHEL 9+ compatible hosts.
- name: Deploy Calcom
hosts: calcom
become: true
vars:
app_root: /opt/calcom
app_port: 3000
db_password: "change-me-to-secure-password"
nextauth_secret: "change-me-openssl-rand-base64-32"
encryption_key: "change-me-openssl-rand-base64-24"
tasks:
- name: Install Docker on Debian/Ubuntu
apt:
name:
- docker.io
- docker-compose-plugin
state: present
update_cache: true
when: ansible_os_family == "Debian"
- name: Install Docker on RHEL family
dnf:
name:
- docker
- docker-compose-plugin
state: present
when: ansible_os_family == "RedHat"
- name: Enable and start Docker
service:
name: docker
state: started
enabled: true
- name: Create application directory
file:
path: "{{ app_root }}"
state: directory
mode: "0755"
- name: Write Docker Compose file
copy:
dest: "{{ app_root }}/docker-compose.yml"
mode: "0644"
content: |
services:
calcom:
image: calcom/cal.com:latest
restart: unless-stopped
ports:
- "{{ app_port }}:3000"
environment:
- DATABASE_URL=postgresql://calcom:{{ db_password }}@db:5432/calcom
- NEXTAUTH_SECRET={{ nextauth_secret }}
- CALENDSO_ENCRYPTION_KEY={{ encryption_key }}
- NEXT_PUBLIC_WEBAPP_URL=http://localhost:{{ app_port }}
depends_on:
db:
condition: service_healthy
db:
image: postgres:15
restart: unless-stopped
environment:
- POSTGRES_USER=calcom
- POSTGRES_PASSWORD={{ db_password }}
- POSTGRES_DB=calcom
volumes:
- db_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U calcom"]
interval: 10s
timeout: 5s
retries: 5
volumes:
db_data:
- name: Create environment file
copy:
dest: "{{ app_root }}/.env"
mode: "0644"
content: |
DATABASE_URL=postgresql://calcom:{{ db_password }}@db:5432/calcom
NEXTAUTH_SECRET={{ nextauth_secret }}
CALENDSO_ENCRYPTION_KEY={{ encryption_key }}
NEXT_PUBLIC_WEBAPP_URL=http://localhost:{{ app_port }}
- name: Start application stack
command: docker compose up -d
args:
chdir: "{{ app_root }}"
## Notes
- Debian baseline: Debian 10 works, but Debian 11/12 is preferred for package freshness.
- Ubuntu hint: Ubuntu 22.04+ is recommended for long-term maintenance.
- RHEL baseline: use RHEL 9+ compatible systems and enabled repositories.
- Replace the container image with the upstream project-recommended image and tag for production.
---
**Any questions?**
Feel free to contact us. Find all contact information on our [contact page](/contact).