> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/calcom/cal.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Deployment Options

> Deploy Cal.com using Docker, Vercel, Railway, or manual installation

Cal.com offers multiple deployment options to suit your infrastructure needs. This guide covers the most popular methods for self-hosting Cal.com.

## Prerequisites

Before deploying Cal.com, ensure you have:

* **Node.js** (Version: >=18.x)
* **PostgreSQL** (Version: >=13.x)
* **Yarn** package manager (recommended)
* Required environment variables configured (see [Configuration](/self-hosting/configuration))

## Docker Deployment

### Quick Start with Docker Compose

The fastest way to deploy Cal.com is using Docker Compose. This method includes PostgreSQL, Redis, and optionally Prisma Studio.

#### 1. Clone the Repository

```bash theme={null}
git clone --recursive https://github.com/calcom/cal.com.git
cd cal.com
```

#### 2. Configure Environment

Copy the example environment file and update it:

```bash theme={null}
cp .env.example .env
```

Minimal required configuration:

```bash theme={null}
# Generate secrets
NEXTAUTH_SECRET=$(openssl rand -base64 32)
CALENDSO_ENCRYPTION_KEY=$(openssl rand -base64 24)

# Generate VAPID keys for push notifications
NEXT_PUBLIC_VAPID_PUBLIC_KEY="your_public_key"
VAPID_PRIVATE_KEY="your_private_key"

# Database (auto-configured by docker-compose)
DATABASE_URL="postgresql://unicorn_user:magical_password@database:5432/calendso"
DATABASE_DIRECT_URL="postgresql://unicorn_user:magical_password@database:5432/calendso"

# Application URL
NEXT_PUBLIC_WEBAPP_URL="http://localhost:3000"
NEXTAUTH_URL="http://localhost:3000"
```

<Note>
  Generate VAPID keys using: `npx web-push generate-vapid-keys`
</Note>

#### 3. Pull Images

```bash theme={null}
docker compose pull
```

<Info>
  By default, images are pulled from `calcom.docker.scarf.sh/calcom/cal.com` for download metrics. The official image is also available at `hub.docker.com/r/calcom/cal.com`.
</Info>

#### 4. Start Services

**Complete stack (PostgreSQL + Cal.com + Prisma Studio):**

```bash theme={null}
docker compose up -d
```

**Cal.com only (external database):**

```bash theme={null}
docker compose up -d calcom
```

**With Prisma Studio for database management:**

```bash theme={null}
docker compose up -d calcom studio
```

#### 5. Access Cal.com

Open your browser to [http://localhost:3000](http://localhost:3000). The first run will launch a setup wizard to create your initial user.

<Note>
  **Optional:** Prisma Studio is available at [http://localhost:5555](http://localhost:5555) for database management. Remove this service in production environments.
</Note>

### Updating Docker Deployment

To update to the latest version:

```bash theme={null}
docker compose down
docker compose pull
docker compose up -d
```

### ARM Architecture Support

For ARM-based systems (Apple Silicon, ARM servers):

```bash theme={null}
docker pull calcom/cal.com:v5.6.19-arm
```

Update your `docker-compose.yml` to use the ARM-specific image tag.

### Docker Services Overview

The default `docker-compose.yml` includes:

* **database**: PostgreSQL 13+ database
* **redis**: Redis for caching and queues
* **calcom**: Main Cal.com web application
* **calcom-api**: Cal.com API v2 service
* **studio**: Prisma Studio (optional, for development)

## Advanced Docker Build

For custom builds or modifications:

### 1. Build Custom Image

```bash theme={null}
# Ensure database is available during build
docker compose up -d database

# Build with custom configuration
DOCKER_BUILDKIT=0 docker compose build calcom
```

<Warning>
  `DOCKER_BUILDKIT=0` is required to enable network bridge during build time. This requirement may be removed in future versions.
</Warning>

### 2. Build-time Arguments

Customize the build with these arguments:

```dockerfile theme={null}
--build-arg NEXT_PUBLIC_WEBAPP_URL=https://your-domain.com
--build-arg NEXT_PUBLIC_LICENSE_CONSENT=true
--build-arg CALCOM_TELEMETRY_DISABLED=1
--build-arg MAX_OLD_SPACE_SIZE=8192
```

## Vercel Deployment

Deploy Cal.com to Vercel with one click:

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fcalcom%2Fcal.com)

<Warning>
  Vercel Pro Plan is required due to serverless function limits on the free tier.
</Warning>

### Vercel Configuration

1. **Required Environment Variables:**

```bash theme={null}
DATABASE_URL="postgresql://user:password@host:5432/db"
NEXT_PUBLIC_WEBAPP_URL="https://your-app.vercel.app"
NEXTAUTH_URL="https://your-app.vercel.app"
NEXTAUTH_SECRET="generate-with-openssl"
CALENDSO_ENCRYPTION_KEY="generate-with-openssl"
CRON_API_KEY="your-cron-key"
```

2. **Build Settings:**

* Build Command: `cd ../.. && yarn build`
* Output Directory: `apps/web/.next`
* Install Command: `yarn install`
* Root Directory: `apps/web/`

3. **External Database Required:**

Vercel deployments require an external PostgreSQL database. Recommended providers:

* [Railway](https://railway.app)
* [Render](https://render.com)
* [Supabase](https://supabase.com)
* [Neon](https://neon.tech)

## Railway Deployment

Deploy Cal.com on Railway:

[![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/new/template/cal)

Railway includes managed PostgreSQL and automatic SSL certificates.

### Railway Setup

1. Click the Deploy button above
2. Connect your GitHub account
3. Configure required environment variables
4. Railway automatically provisions PostgreSQL
5. Access your deployment at the provided Railway URL

See [Railway's detailed guide](https://blog.railway.app/p/calendso) for more information.

## Northflank Deployment

Deploy Cal.com on Northflank:

[![Deploy on Northflank](https://assets.northflank.com/deploy_to_northflank_smm_36700fb050.svg)](https://northflank.com/stacks/deploy-calcom)

Northflank provides managed infrastructure with built-in CI/CD.

## Render Deployment

Deploy Cal.com on Render:

[![Deploy to Render](https://render.com/images/deploy-to-render-button.svg)](https://render.com/deploy?repo=https://github.com/calcom/docker)

Render includes managed PostgreSQL and automatic HTTPS.

## Manual Installation

For bare-metal or VM deployments:

### 1. Install Dependencies

```bash theme={null}
# Install Node.js 18+
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install -y nodejs

# Install Yarn
npm install -g yarn

# Install PostgreSQL 13+
sudo apt-get install postgresql postgresql-contrib
```

### 2. Clone and Install

```bash theme={null}
git clone https://github.com/calcom/cal.com.git
cd cal.com
yarn install
```

### 3. Configure Environment

```bash theme={null}
cp .env.example .env
# Edit .env with your configuration
```

### 4. Setup Database

```bash theme={null}
# Create database
sudo -u postgres createdb calendso

# Run migrations
yarn workspace @calcom/prisma db-deploy
```

### 5. Build and Start

**Development:**

```bash theme={null}
yarn dev
```

**Production:**

```bash theme={null}
yarn build
yarn start
```

### 6. Process Manager (Production)

Use PM2 to keep Cal.com running:

```bash theme={null}
npm install -g pm2
pm2 start yarn --name "calcom" -- start
pm2 startup
pm2 save
```

## Reverse Proxy Setup

### Nginx Configuration

```nginx theme={null}
server {
    listen 80;
    server_name your-domain.com;
    
    location / {
        proxy_pass http://localhost:3000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}
```

### SSL with Let's Encrypt

```bash theme={null}
sudo apt-get install certbot python3-certbot-nginx
sudo certbot --nginx -d your-domain.com
```

## Healthcheck

Cal.com includes a built-in healthcheck endpoint:

```bash theme={null}
curl http://localhost:3000/api/health
```

The Docker image includes automatic health monitoring:

```dockerfile theme={null}
HEALTHCHECK --interval=30s --timeout=30s --retries=5 \
  CMD wget --spider http://localhost:3000 || exit 1
```

## Troubleshooting

### SSL Edge Termination

If running behind a load balancer handling SSL:

```bash theme={null}
NODE_TLS_REJECT_UNAUTHORIZED=0
```

<Warning>
  Only use this if you trust your load balancer. Do not use in untrusted networks.
</Warning>

### CLIENT\_FETCH\_ERROR

If NextAuth cannot resolve the hostname:

```bash theme={null}
NEXTAUTH_URL=http://localhost:3000/api/auth
```

### VAPID Keys Error

If you see "No key set vapidDetails.publicKey":

```bash theme={null}
# Generate keys
npx web-push generate-vapid-keys

# Add to .env
NEXT_PUBLIC_VAPID_PUBLIC_KEY="your_public_key"
VAPID_PRIVATE_KEY="your_private_key"
```

### Database Connection Issues

Ensure your database URL is correctly formatted:

```bash theme={null}
DATABASE_URL="postgresql://user:password@host:5432/database?sslmode=require"
```

## Production Checklist

* [ ] Set strong `NEXTAUTH_SECRET` and `CALENDSO_ENCRYPTION_KEY`
* [ ] Configure proper `DATABASE_URL` with connection pooling
* [ ] Set correct `NEXT_PUBLIC_WEBAPP_URL` for your domain
* [ ] Generate and configure VAPID keys for push notifications
* [ ] Configure email provider (SendGrid, SMTP, or Resend)
* [ ] Remove Prisma Studio service from docker-compose
* [ ] Enable SSL/HTTPS with valid certificates
* [ ] Configure backup strategy for PostgreSQL
* [ ] Set up monitoring and logging
* [ ] Review and configure [CSP policy](/self-hosting/configuration#security)
* [ ] Disable telemetry if required: `CALCOM_TELEMETRY_DISABLED=1`

## Next Steps

* Configure [environment variables](/self-hosting/configuration)
* Set up [database and migrations](/self-hosting/database)
* Review [Docker-specific options](/self-hosting/docker)
