On this page
- How much server does Cal.com need?
- How do you write the environment file?
- What does the compose file look like?
- How do you start the app and test it locally?
- How do you put Cal.com behind HTTPS?
- How do you create the admin and the first event type?
- How do booking emails get delivered?
- How do you back up, update and troubleshoot it?
- Questions
How much server does Cal.com need?
Cal.com is a Next.js application, so it is heavier than a typical small web app: allow 2 vCPU and 4 GB of memory, or 2 GB with a swap file for a single user. PostgreSQL holds users, event types and bookings.
- Docker Engine and the Compose plugin from Docker Engine, or the Docker app image.
- A hostname like
cal.example.netpointed at198.51.100.24and2001:db8:4f2a::24, as described in DNS records. - SMTP credentials for a relay, so invitees receive confirmations and calendar files.
docker compose version
free -hHow do you write the environment file?
Keep all settings in one .env file next to the compose file; generate the two secrets with OpenSSL.
mkdir -p ~/calcom && cd ~/calcom
openssl rand -base64 32 # NEXTAUTH_SECRET
openssl rand -base64 24 # CALENDSO_ENCRYPTION_KEY
nano .envPOSTGRES_USER=calcom
POSTGRES_PASSWORD=strong-db-password
POSTGRES_DB=calcom
DATABASE_URL=postgresql://calcom:strong-db-password@database:5432/calcom
DATABASE_DIRECT_URL=postgresql://calcom:strong-db-password@database:5432/calcom
NEXT_PUBLIC_WEBAPP_URL=https://cal.example.net
NEXTAUTH_URL=https://cal.example.net/api/auth
NEXTAUTH_SECRET=paste-first-secret
CALENDSO_ENCRYPTION_KEY=paste-second-secret
CALCOM_TELEMETRY_DISABLED=1
EMAIL_FROM=booking@example.net
EMAIL_SERVER_HOST=smtp.relay.example.net
EMAIL_SERVER_PORT=587
EMAIL_SERVER_USER=relay-user
EMAIL_SERVER_PASSWORD=relay-passwordThe encryption key protects stored credentials for connected calendars, so keep a copy somewhere safe: losing it breaks those connections. Protect the file with chmod 600 .env.
What does the compose file look like?
Two services, the database and the app, with the app bound to loopback:
services:
database:
image: postgres:16
restart: always
env_file: .env
volumes:
- cal-db:/var/lib/postgresql/data
calcom:
image: calcom/cal.com:latest
restart: always
env_file: .env
depends_on:
- database
ports:
- "127.0.0.1:3000:3000"
volumes:
cal-db:Save it as ~/calcom/compose.yaml. Swap latest for a version tag from Docker Hub when you want controlled upgrades. The published image is built with a placeholder URL that its start script replaces with your NEXT_PUBLIC_WEBAPP_URL; if links ever show the placeholder, the project also documents building the image yourself with the URL as a build argument.
How do you start the app and test it locally?
Start both containers; the app runs database migrations on start, which takes a little while the first time.
cd ~/calcom
docker compose up -d
docker compose logs -f calcom # wait for the ready message, then Ctrl+C
curl -sI http://127.0.0.1:3000 | head -n 1
sudo ss -tlnp | grep 3000A 200 or a redirect to the login page proves the app answers, and ss should list only 127.0.0.1:3000.
How do you put Cal.com behind HTTPS?
Booking pages must be served over HTTPS, since the login session cookie and calendar integrations depend on it. Install Nginx and Certbot and add /etc/nginx/sites-available/calcom:
server {
listen 80;
listen [::]:80;
server_name cal.example.net;
location / {
proxy_pass http://127.0.0.1:3000;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}sudo apt install -y nginx certbot python3-certbot-nginx
sudo ln -s /etc/nginx/sites-available/calcom /etc/nginx/sites-enabled/
sudo nginx -t && sudo systemctl reload nginx
sudo certbot --nginx -d cal.example.net
sudo ufw allow OpenSSH && sudo ufw allow 'Nginx Full' && sudo ufw enableCaddy users write cal.example.net { reverse_proxy 127.0.0.1:3000 } across three lines instead (Caddy HTTPS).
How do you create the admin and the first event type?
Visit https://cal.example.net/auth/setup: the first screen creates the administrator account, and the following steps let you pick a license option and enable apps. Then sign in, set your availability and time zone, and create an event type such as a 30 minute call. Your public booking link is https://cal.example.net/ followed by your username.
Calendar sync with services like Google Calendar or Microsoft 365 needs OAuth credentials from that service, added as extra environment variables; the Cal.com docs list the variable names for each app.
How do booking emails get delivered?
Cal.com sends through the EMAIL_SERVER_* settings, so point them at an authenticated relay on port 587; that works on any server. Outbound port 25 may be closed on new instances, so ask support with a ticket before planning direct delivery. To keep confirmations out of spam, publish SPF and DKIM for example.net as in SMTP relay for apps. Book a test slot with a second address to confirm both parties receive the invite.
How do you back up, update and troubleshoot it?
Everything important sits in PostgreSQL plus your .env file.
cd ~/calcom
docker compose exec -T database pg_dump -U calcom calcom | gzip > calcom-$(date +%F).sql.gz
docker compose pull
docker compose up -d- Login fails or loops:
NEXTAUTH_URLorNEXT_PUBLIC_WEBAPP_URLdoes not match the HTTPS address. - Container exits on start: read
docker compose logs calcom; a wrongDATABASE_URLis common. - Out of memory: add swap or deploy a larger plan and migrate (move to a larger plan).
Plans that fit this guide
Base city prices. Every plan includes a dedicated IPv4 address, IPv6, full root and all 18 images.
Questions about Cal.com scheduling
Is self-hosted Cal.com free?
The core is open source under the AGPLv3 license. Some team and enterprise features need a commercial license key, which the setup wizard asks about.
Can I use my own domain for booking links?
Yes. The links use whatever you set in NEXT_PUBLIC_WEBAPP_URL, here cal.example.net.
Does Cal.com work with video meetings?
Yes, through apps for several video services, and you can also point event locations at your own Jitsi Meet server with a fixed link.
Why keep the encryption key?
It encrypts stored calendar and app credentials. Restoring a database with a different key leaves those integrations unreadable.
Can several people share one instance?
Yes. Each user gets a booking page, and teams can use round-robin or collective event types.
More in Self-hosted apps
- Nextcloud on Nginx
- ownCloud Infinite Scale
- Seafile file sync
- Vaultwarden password vault
- Passbolt team password manager
- Gitea Git hosting
- Forgejo Git server
- GitLab Community Edition
- Gogs Git service
- Wiki.js
- BookStack documentation
- Outline knowledge base
- Paperless-ngx documents
- n8n workflow automation
- Activepieces automation
- Plausible Analytics (Community Edition)
- Umami analytics
- Mattermost team chat
- Matrix Synapse with Element
- Jitsi Meet video calls
- ONLYOFFICE Docs with Nextcloud
- HashiCorp Vault secrets server
- OpenBao secrets management
- Infisical secrets manager
- Authelia SSO and forward auth
- Zitadel identity platform
- VS Code in the browser (code-server)
- Joplin Server for notes sync
- Firefly III personal finance
- Snipe-IT asset tracking
- Odoo ERP on Ubuntu or Debian
- ERPNext with frappe_docker
- Dolibarr ERP and CRM with Nginx
- Penpot design tool with Docker
- Planka kanban boards
- Leantime project management
- Wekan boards with Docker
- Chatwoot support inbox
- Mautic marketing automation
- DocuSeal document signing
- Metabase dashboards
- Appwrite backend server
- Self-hosted Supabase
- PocketBase backend
- RustDesk relay server
- Traccar GPS tracking
- Redmine project tracker
- The Lounge IRC client
- CyberChef data toolbox
- Typebot chat forms
- AFFiNE workspace
- Overleaf Community Edition
- Neko shared virtual browser
- imgproxy image resizing
- NetBox network inventory
- UVdesk help desk
- YetiForce CRM