If you need online scheduling but do not want every appointment, client email, and calendar connection tied to a hosted SaaS account, self-hosting Cal.com is a practical alternative. Cal.com gives you booking pages, event types, availability rules, calendar integrations, and team scheduling while allowing the application and database to run on infrastructure you control.
This guide walks through the current Docker-based deployment path for Cal.diy, the open-source distribution documented by the Cal.com project. You will create a private instance, configure its URL and authentication secret, put it behind HTTPS, and maintain it safely over time.
What is Cal.com and why self-host it?
Cal.com is an open scheduling platform that lets people book time with you through a public link. Instead of sending several messages to find a suitable time, you define your availability and event types, then share a booking page. It can be used by freelancers, consultants, support teams, recruiters, sales teams, and families coordinating appointments.
Self-hosting is useful when privacy, branding, or operational control matters. You can use your own domain, choose where data is stored, control backups, and avoid depending on a hosted plan for basic functionality. It also fits naturally into a homelab or small VPS stack alongside services such as Authentik for single sign-on and Tailscale for private remote access.
There are trade-offs. You are responsible for updates, HTTPS, backups, email delivery, database health, and troubleshooting. Cal.diy’s Docker configuration is maintained in the main project repository, but Docker deployment may not receive the same official support expectations as a managed hosted service. Treat the deployment as production software, not as a one-time container experiment.
Requirements before you start
You need a Linux server or another machine that can run Docker Engine and Docker Compose. A small VPS with at least 2 GB of RAM is a reasonable starting point for a personal instance, although actual requirements depend on concurrent users and enabled services. You also need:
- A domain or subdomain such as
calendar.example.com. - DNS pointing that hostname to the server.
- Docker and the
docker composecommand. - A reverse proxy that can issue TLS certificates.
- An SMTP provider if you want reliable invitation and notification emails.
- A backup destination that is separate from the application server.
Before exposing the service, read the current official Cal.com Docker documentation. Project images, environment variables, and deployment instructions can change.
Clone the official Docker configuration
The documented workflow uses the Cal.diy repository rather than an improvised one-container command. This matters because the repository contains the maintained Dockerfile and Compose configuration, including the supporting database service used by the default stack.
mkdir -p ~/docker
cd ~/docker
git clone https://github.com/calcom/cal.diy.git
cd cal.diy
cp .env.example .env
Open .env and review every value before starting the stack. At minimum, set a strong authentication secret and the public URL that users will visit:
NEXTAUTH_SECRET=replace-this-with-a-long-random-secret
NEXT_PUBLIC_WEBAPP_URL=https://calendar.example.com
Generate a secret instead of typing a short phrase:
openssl rand -base64 48
Do not commit .env to a public repository. It can contain database credentials, authentication secrets, and provider keys. Restrict its permissions on the server:
chmod 600 .env
Cal.diy also documents build-time variables such as NEXT_PUBLIC_TELEMETRY_KEY, NEXT_PUBLIC_LICENSE_CONSENT, and NEXT_PUBLIC_WEBAPP_URL. The exact behavior of these variables depends on the current image and repository version, so use the .env.example file from the checkout as the authoritative starting point.
Start Cal.diy with Docker Compose
For the first run, the official documentation provides a complete stack that includes the web application, a local Postgres database, and Prisma Studio. Pull images first so errors are easier to distinguish from a slow first startup:
docker compose pull
docker compose up -d
Inspect the services and logs:
docker compose ps
docker compose logs --tail=100 calcom
The initial web interface is normally available on port 3000. Visit http://SERVER_IP:3000 only for a local test; do not leave an unauthenticated application exposed directly to the public internet. The first-run wizard should let you define the first user. After that, immediately verify that the public URL and authentication flow work through your intended hostname.
If you already operate Postgres elsewhere, the documentation also describes running the web application and Prisma Studio against a remote database by setting DATABASE_URL and starting selected services. A remote database can make backups and operations more consistent, but it adds network and credential management. Start with the included stack unless you already have a clear reason to separate the database.
Put Cal.com behind HTTPS
The Docker service is not your internet-facing security boundary. Use a reverse proxy such as Caddy, Nginx Proxy Manager, or Traefik to terminate TLS and forward requests to the Cal.com container. A minimal Caddy example looks like this:
calendar.example.com {
reverse_proxy 127.0.0.1:3000
}
If Caddy runs in a separate Docker network, use the Compose service name instead of 127.0.0.1. Make sure the DNS record is already correct and that ports 80 and 443 reach the proxy. After the certificate is issued, open the HTTPS URL in a private browser window and test sign-in, a public booking page, and a test email.
Do not use a permanent insecure workaround such as disabling TLS verification unless you fully understand the edge-termination arrangement. The official troubleshooting notes mention NODE_TLS_REJECT_UNAUTHORIZED=0 for specific SSL edge cases; that setting weakens certificate verification and should not be your default fix.
Configure calendars, email, and booking rules
A scheduling application is only useful when its availability is accurate. Connect the calendar provider you actually use, then create a test event type with a short duration. Check buffers, working hours, minimum notice, maximum days in advance, and timezone behavior. Test an appointment as an anonymous visitor and confirm it appears on the connected calendar.
Configure SMTP before inviting real clients. A working SMTP provider is more reliable than trying to send mail directly from a residential server. Test confirmation, cancellation, rescheduling, and reminder messages. If the email contains a wrong hostname or HTTP link, revisit NEXT_PUBLIC_WEBAPP_URL and the current runtime variables.
Use a separate event type for each workflow rather than exposing your entire calendar. Keep administrative accounts limited, and avoid sharing a booking URL until its timezone, duration, and notification behavior have been tested.
Updates and backups
The official update workflow is deliberately simple:
docker compose down
git pull
docker compose pull
docker compose up -d
Read release notes before updating. Back up the database before every upgrade and retain a copy outside the server. A backup is not proven until you have restored it somewhere else. If the default stack uses a named Docker volume, identify it with docker volume ls and use a database-aware backup method rather than copying a live database file blindly.
Keep the repository checkout, .env, database backup, and reverse-proxy configuration organized separately. Monitor disk space and container health. For a lightweight availability check, Uptime Kuma can alert you when the booking endpoint stops responding, but an HTTP 200 check alone does not prove that calendar synchronization or email delivery works.
Common problems
The page redirects to the wrong hostname. Check NEXT_PUBLIC_WEBAPP_URL and any authentication URL variables. Recreate the containers after changing environment values.
Users see a client fetch error. This can happen when the configured web URL cannot be resolved from inside the container or when the reverse proxy and application disagree about the public scheme. Confirm DNS, proxy headers, and the documented NEXTAUTH_URL guidance before changing TLS verification.
The container starts but the database is unavailable. Run docker compose logs for both application and database services. Check that the database hostname in DATABASE_URL matches the Compose service name and that the database has completed initialization.
Emails never arrive. Verify SMTP credentials, sender policy, provider restrictions, and spam folders. Test from the application after confirming the public URL is correct.
FAQ
Is self-hosted Cal.com free?
The software and Docker configuration are available as open-source project materials, but hosting, email, backups, and maintenance still cost time or money. Review the current project licensing and feature terms before using it commercially.
Can I run it on a Raspberry Pi?
Architecture support depends on the current image. The documentation notes an ARM image suffix for supported Cal.diy releases. Confirm the exact tag and architecture before deploying, rather than assuming the default image will work.
Should I expose port 3000 directly?
No. Bind the service privately where possible and expose it through a reverse proxy with HTTPS, authentication, firewall rules, and a real domain.
Is the included Postgres database enough for production?
It can be a practical starting point for a small instance, but you still need tested backups, monitoring, and a recovery plan. Larger or business-critical deployments may benefit from a separately managed Postgres service.
What should I do before inviting clients?
Create a test event, connect a test calendar, verify timezone and buffers, send test emails, complete a booking anonymously, and restore a backup at least once. These checks catch most embarrassing scheduling failures before they affect real appointments.
Self-hosted Cal.com is most valuable when treated as an operational service: keep the official deployment files current, protect the environment file, use HTTPS, and test recovery instead of relying on a green container status alone.