Self-hosting
Installation

Installation

To get a local copy up and running, please follow these simple steps.

Prerequisites

Here is what you need to be able to run Cal.

  • Node.js
  • PostgreSQL
  • Yarn (recommended)

If you want to enable any of the available integrations, you may want to obtain additional credentials for each one. More details on this can be found below under the integrations category.

Setup

  1. Clone the repo

    git clone https://github.com/hiboxco/hiboxscheduler.git
  2. Go to the project folder

    cd cal.com
  3. Copy .env.example to .env

    cp apps/web/.env.example apps/web/.env
    cp packages/prisma/.env.example packages/prisma/.env
  4. Install packages with yarn

    yarn

Quick start with yarn dx

  • Requires Docker and Docker Compose to be installed
  • Will start a local Postgres instance with a few test users - the credentials will be logged in the console
yarn dx

Manual setup

  1. Configure database in the packages/prisma/.env file. Replace <user>, <pass>, <db-host>, <db-port> with their applicable values

    DATABASE_URL='postgresql://<user>:<pass>@<db-host>:<db-port>'

    If you don't know how to configure the DATABASE_URL, then follow the steps here to create a quick DB using Heroku

    1. Create a free account with Heroku (opens in a new tab).

    2. Create a new app.

    Create an App
    1. In your new app, go to Overview and next to Installed add-ons, click Configure Add-ons. We need this to set up our database. image

    2. Once you clicked on Configure Add-ons, click on Find more add-ons and search for postgres. One of the options will be Heroku Postgres - click on that option. image

    3. Once the pop-up appears, click Submit Order Form - plan name should be Hobby Dev - Free.

    Submit Order Form
    1. Once you completed the above steps, click on your newly created Heroku Postgres and go to its Settings. image

    2. In Settings, copy your URI to your scheduler.hibox.co .env file and replace the postgresql://<user>:<pass>@<db-host>:<db-port> with it. image image

    3. To view your DB, once you add new data in Prisma, you can use Heroku Data Explorer (opens in a new tab).

  2. Set a 32 character random string in your apps/web/.env file for the CALENDSO_ENCRYPTION_KEY (You can use a command like openssl rand -base64 24 to generate one).

  3. Set up the database using the Prisma schema (found in packages/prisma/schema.prisma)

    yarn workspace @calcom/prisma db-deploy
  4. Run (in development mode)

    yarn dev

Setting up your first user

  1. Open Prisma Studio (opens in a new tab) to look at or modify the database content:

    yarn db-studio
  2. Click on the User model to add a new user record.

  3. Fill out the fields email, username, password, and set metadata to empty {} (remembering to encrypt your password with BCrypt (opens in a new tab)) and click Save 1 Record to create your first user.

    New users are set on a TRIAL plan by default. You might want to adjust this behavior to your needs in the prisma/schema.prisma file.

  4. Open a browser to port 3000 (opens in a new tab) and login with your just created, first user.