Skip to main content

Introduction

This image can be found on DockerHub at https://hub.docker.com/r/calcom/cal.com. Note for ARM Users: Use the -arm suffix for pulling images. Example: docker pull calcom/cal.com:v5.6.19-arm.

Contributing

The Docker configuration for Cal.com is officially maintained in the main Cal.com repository. The Dockerfile and docker-compose.yml are located in the root of the calcom/cal.com repository. If you want to contribute to the Docker setup, please open an issue or pull request in the main Cal.com repository.

Requirements

Make sure you have docker & docker compose installed on the server / system. Note: docker compose without the hyphen is now the primary method of using docker-compose, per the Docker documentation.

Getting Started

  1. Clone the Cal.com repository
    git clone https://github.com/calcom/cal.com.git
    
  2. Change into the directory
    cd cal.com
    
  3. Prepare your configuration: Rename .env.example to .env and then update .env
    cp .env.example .env
    
    Most configurations can be left as-is, but for configuration options see Important Run-time variables below. Update the appropriate values in your .env file, then proceed.
  4. (optional) Pre-Pull the images by running the following command
    docker compose pull
    
  5. Start Cal.com via docker compose (Most basic users, and for First Run) To run the complete stack, which includes a local Postgres database, Cal.com web app, and Prisma Studio:
    docker compose up -d
    
    To run Cal.com web app and Prisma Studio against a remote database, ensure that DATABASE_URL is configured for an available database and run:
    docker compose up -d calcom studio
    
    To run only the Cal.com web app, ensure that DATABASE_URL is configured for an available database and run:
    docker compose up -d calcom
    
  6. Open a browser to http://localhost:3000, or your defined NEXT_PUBLIC_WEBAPP_URL. The first time you run Cal.com, a setup wizard will initialize. Define your first user, and you’re ready to go!

Update Calcom Instance

  1. Stop the Cal.com stack
    docker compose down
    
  2. Pull the latest changes
    docker compose pull
    
  3. Update environment variables as necessary.
  4. Re-start the Cal.com stack
    docker compose up -d
    

Configuration

Build-time variables

These variables must be provided at the time of the docker build, and can be provided by updating the .env file. Changing these is not required for evaluation, but may be required for running in production. Currently, if you require changes to these variables, you must follow the instructions to build and publish your own image.
  • NEXT_PUBLIC_WEBAPP_URL
  • NEXT_PUBLIC_LICENSE_CONSENT
  • NEXT_PUBLIC_TELEMETRY_KEY

Important Run-time variables

  • NEXTAUTH_SECRET

Advanced Users - Building and Configuring

For more detailed instructions on how to build and configure your own Docker image, refer to the Dockerfile and docker-compose.yml in the root of the Cal.com repository.

Troubleshooting

  • SSL edge termination: If running behind a load balancer which handles SSL certificates, you will need to add the environmental variable NODE_TLS_REJECT_UNAUTHORIZED=0 to prevent requests from being rejected. Only do this if you know what you are doing and trust the services/load-balancers directing traffic to your service.
  • Failed to commit changes: Invalid ‘prisma.user.create()’: Certain versions may have trouble creating a user if the field metadata is empty. Using an empty json object {} as the field value should resolve this issue. Also, the id field will autoincrement, so you may also try leaving the value of id as empty.

CLIENT_FETCH_ERROR

If you experience this error, it may be the way the default Auth callback in the server is using the WEBAPP_URL as a base url. The container does not necessarily have access to the same DNS as your local machine, and therefor needs to be configured to resolve to itself. You may be able to correct this by configuring NEXTAUTH_URL=http://localhost:3000/api/auth, to help the backend loop back to itself.
docker-calcom-1  | @calcom/web:start: [next-auth][error][CLIENT_FETCH_ERROR]
docker-calcom-1  | @calcom/web:start: https://next-auth.js.org/errors#client_fetch_error request to http://testing.localhost:3000/api/auth/session failed, reason: getaddrinfo ENOTFOUND testing.localhost {
docker-calcom-1  | @calcom/web:start:   error: {
docker-calcom-1  | @calcom/web:start:     message: 'request to http://testing.localhost:3000/api/auth/session failed, reason: getaddrinfo ENOTFOUND testing.localhost',
docker-calcom-1  | @calcom/web:start:     stack: 'FetchError: request to http://testing.localhost:3000/api/auth/session failed, reason: getaddrinfo ENOTFOUND testing.localhost\n' +
docker-calcom-1  | @calcom/web:start:       '    at ClientRequest.<anonymous> (/calcom/node_modules/next/dist/compiled/node-fetch/index.js:1:65756)\n' +
docker-calcom-1  | @calcom/web:start:       '    at ClientRequest.emit (node:events:513:28)\n' +
docker-calcom-1  | @calcom/web:start:       '    at ClientRequest.emit (node:domain:489:12)\n' +
docker-calcom-1  | @calcom/web:start:       '    at Socket.socketErrorListener (node:_http_client:494:9)\n' +
docker-calcom-1  | @calcom/web:start:       '    at Socket.emit (node:events:513:28)\n' +
docker-calcom-1  | @calcom/web:start:       '    at Socket.emit (node:domain:489:12)\n' +
docker-calcom-1  | @calcom/web:start:       '    at emitErrorNT (node:internal/streams/destroy:157:8)\n' +
docker-calcom-1  | @calcom/web:start:       '    at emitErrorCloseNT (node:internal/streams/destroy:122:3)\n' +
docker-calcom-1  | @calcom/web:start:       '    at processTicksAndRejections (node:internal/process/task_queues:83:21)',
docker-calcom-1  | @calcom/web:start:     name: 'FetchError'
docker-calcom-1  | @calcom/web:start:   },
docker-calcom-1  | @calcom/web:start:   url: 'http://testing.localhost:3000/api/auth/session',
docker-calcom-1  | @calcom/web:start:   message: 'request to http://testing.localhost:3000/api/auth/session failed, reason: getaddrinfo ENOTFOUND testing.localhost'
docker-calcom-1  | @calcom/web:start: }