The Ultimate Guide to Setting Up Open-Source Cal.com Locally!
Your ultimate resource for installing Open-Source Cal.com!
Introduction
Hey there, fellow developers! If you've ever felt the frustration of struggling with local deployment, you're not alone. I've been there, and that's why I'm excited to share my journey with you. In this comprehensive guide, I'll walk you through the process step by step, making local deployment a breeze. Whether you're a seasoned developer or just getting started, this guide is designed to help you navigate the complexities and intricacies of setting up Open-Source Cal.com on your local machine like a Pro.
Prerequisites
Git Bash
Yarn ( Recommended )
Node.Js (Version: >=18.x)
Docker and Docker Compose
Local or Cloud PostgreSQL server ( Supabase )
What is Cal.com?
Cal.com is an open-source alternative to Calendly. With complete control over data, appearance, and workflow, Cal.com offers self-hosting or managed options, white-label customization, API integration, domain deployment, event customization, and data security. Experience scheduling freedom and efficiency while maintaining full ownership of your scheduling process.
Steps to setup the Cal.com locally
Let's get started without any further delay
Step 1: Project setup
Fork the project from Calcom/cal.com to your personal GitHub.
Clone the repo into your local Windows machine using Git bash with Admin privileges
git clone -c core.symlinks=true https://github.com/calcom/cal.com.git
Open the project folder in your IDE and Install packages with
yarn
.yarn
If you don't have
yarn
install it using the command:npm install --global yarn
Check that
yarn
is installed by running:yarn --version
Step 2: Database Setup
Here I've used Supabase ( an open-source cloud database service ) to work with the database.
Create a new project and set the password.
Copy the URI from Project Settings > Database > Connection String > URI
Step 3: Docker Setup
Check if your Docker is running or not.
If not then
start
the Docker Desktop Service.
Step 4: .env Setup
Duplicate
.env.example
to.env
using the command:cp .env.example .env
Replace the copied database URI with the DATABASE_URL & add your project password.
Generate a
NEXTAUTH_SECRET
using:openssl rand -base64 32
Generate a
CALENDSO_ENCRYPTION_KEY
using:openssl rand -base64 24
If you don't have openssl in your local machine then you can run the command on Git Bash also.
Also, add
NEXT_PUBLC_DEBUG=1
anywhere in the .env.echo 'NEXT_PUBLIC_DEBUG=1' >> .env
Finally, make
PRISMA_GENERATE_DATAPROXY=true
.
Step 5: Running the project locally
Start the local server using the command
yarn dx
on the terminalyarn dx
Open another new terminal and run the command to set up the development environment using the Prisma schema:
yarn workspace @calcom/prisma db-migrate
In a production environment, run:
yarn workspace @calcom/prisma db-deploy
If the project is not running then use the command:
yarn dev
Step 6: Setting up your first user
Open Prisma Studio to look at or modify the database content:
yarn db-studio
It should open on http://localhost:5555/
Click on the
user
model to add a new user record.Fill out the fields
email
,username
,password
, and setmetadata
to empty{}
Don't forget to encrypt your password with BCrypt and click
Save 1 Record
to create your first user.Open a browser to http://localhost:3000 and login with your just created, first user.
Conclusion:
So in the end I hope that this guide not only helps you set up Cal.com locally but also sparks a sense of achievement in your developer's heart. Happy coding, fellow adventurers!