Back to Cal

GCP

docs/self-hosting/deployments/gcp.mdx

6.2.04.8 KB
Original Source

Deploying Cal.com on Google Cloud Platform (GCP)

In this guide, we will go over the steps to deploy Cal.com on Google Cloud Platform (GCP). We will cover how to create a virtual machine, configure it, install Docker, and finally deploy the Cal.com application.

One Click Deployment

<a href="https://deploy.cloud.run/?git_repo=https://github.com/calcom/docker" target="_blank"> </a>

Manual Deployment

<Steps> <Step title="Creating a Virtual Machine"> ### Go to the GCP Console
    First, open the Google Cloud Platform console by visiting the [https://console.cloud.google.com/](https://console.cloud.google.com/) website.

    ### Create a New Project

    If you haven't already, create a new project by clicking on the "Select a project" dropdown menu and selecting "New Project". Enter a name for your project and click on the "Create" button.

    


    ### Create a New VM Instance

    Click on the navigation menu icon (three horizontal lines) and select "Compute Engine" from the list. Then, click on "VM instances" in the sub-menu.

    Click on the "Create" button to create a new virtual machine.

    


    ### Select the Machine Type

    Choose the machine type that best suits your needs. Ideally, 2 vCPUs and 2-4GB RAM is enough.

    ### Set Up Networking

    Make sure the "Networking" tab is selected and click on the "Add network" button. Choose the "Default" network and click on the "Add" button.


    ### Create the Instance

    Review the details of your virtual machine and click on the "Create" button to create the instance.

    
    Note the public IP of the VM.
</Step>
<Step title="Configuring the Virtual Machine">
    Once your virtual machine is created, you need to configure it to allow traffic on port 80.

    ### Open Port 80

    Click on the navigation menu icon (three horizontal lines) and select "Compute Engine" from the list. Then, click on "VM instances" in the sub-menu. Find your newly created instance and click on its name to enter its details page.

    Click on the "Firewalls" tab and then click on the "Add firewall rule" button. Select "Allow all" as the source and destination, set the protocol to "tcp" and the ports to "80". Click on the "Add" button to save the changes.
</Step>
<Step title="Installing Docker">
    Now that your virtual machine is configured, you need to install Docker on it.

    ### Connect to Your Instance

    Open a terminal window on your local machine and use SSH to connect to your virtual machine. You can find the external IP address or DNS name of your instance in the GCP console. Use the following command to connect to your instance:
    ```bash
    gcloud ssh --project=[PROJECT_ID] --zone=[ZONE] [INSTANCE_NAME]
    ```
    Replace `[PROJECT_ID]` with your project ID, `[ZONE]` with the zone where your instance is located, and `[INSTANCE_NAME]` with the name of your instance.
    You can also use web based SSH.

    


    ### Install Docker

    Once connected, update the package list and install Docker using the following commands:
    ```bash
    sudo apt-get update
    sudo apt-get install docker.io
    ```
    ### Start the Docker Service

    Start the Docker service using the following command:
    ```bash
    sudo systemctl start docker
    ```
</Step>
<Step title="Deploying Cal.com">
    Now that Docker is installed and running, you can deploy Cal.com on your virtual machine.

    ### Pull the Docker Image

    Use the following command to pull the Cal.com Docker image from Docker Hub:
    ```bash
    docker pull cal/calcom
    ```
    ### Run the Docker Container

    Run the Docker container using the following command:
    ```bash
    docker run -d -p 80:80 cal/cal.com
    ```
    This command maps port 80 on your local machine to port 80 inside the container, so you can access Cal.com from outside the container.

    ### Access Cal.com

    Open a web browser and navigate to `http://localhost`. You should now be able to access the Cal.com homepage.
</Step>
</Steps>

Congratulations! You have successfully deployed Cal.com on Google Cloud Platform.