Log inSign up

Your own Cal.com booking pages on a VPS

Run the calcom/cal.com Docker image next to a PostgreSQL container, with NEXT_PUBLIC_WEBAPP_URL set to https://cal.example.net and fresh values for NEXTAUTH_SECRET and CALENDSO_ENCRYPTION_KEY. Publish the app on 127.0.0.1:3000, front it with Nginx or Caddy for HTTPS, then open /auth/setup to create the admin. Booking confirmations go out through an SMTP relay on port 587.

Topic: Self-hosted apps · Tested on: Ubuntu 24.04 and 22.04, Debian 12 and 13 · Updated 2026-12-03

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.net pointed at 198.51.100.24 and 2001:db8:4f2a::24, as described in DNS records.
  • SMTP credentials for a relay, so invitees receive confirmations and calendar files.
docker compose version
free -h

How 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 .env
POSTGRES_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-password

The 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 3000

A 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 enable

Caddy 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_URL or NEXT_PUBLIC_WEBAPP_URL does not match the HTTPS address.
  • Container exits on start: read docker compose logs calcom; a wrong DATABASE_URL is 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.

All prices
PlanFits becauseSizeMonthlyOrder from
A2-4a few users with integrations2 vCPU, 4 GB RAM, 100 GB NVMe$14.40/mo$43.20 for 3 months
A2-2a single user with swap2 vCPU, 2 GB RAM, 60 GB NVMe$10.80/mo$64.80 for 6 months

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.