> For the complete documentation index, see [llms.txt](https://calcom.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://calcom.gitbook.io/docs/introduction/quick-start/self-hosting/installation/platform/api-submodule.md).

# API submodule

### Already have a Calcom repo clone?

If you have already cloned the calcom repo (from [Installation](/docs/introduction/quick-start/self-hosting/installation.md)), all you need to do is run the following command to add the API submodule to the existing repository

```git
git-setup.sh api
```

{% hint style="info" %}
This script uses SSH authentication, so you would need to make sure that you have connected your github account which has the API access to your machine using SSH. If you haven't already done so then you can simply follow the instructions provided on [github documentation here](https://docs.github.com/en/authentication/connecting-to-github-with-ssh).
{% endhint %}

Now that you have cloned the API repo, you can get up and running by going through the following steps:

#### Step 1

Copy the .env files from their respective example files:

```powershell
cp apps/api/.env.example apps/api/.env
cp .env.example .env
```

#### Step 2

Install packages with yarn:

```powershell
yarn
```

### Running API server

Run the API with yarn:

```powershell
yarn workspace @calcom/api dev
```

{% hint style="info" %}
On windows, you would need to update the script to explicitly set port to 3002 and run yarn dev under `apps/api/package.json`\
\
So, it should look something like this after the changes:

`"dev": "set PORT=3002 && next dev"`\
\
Now, running `yarn workspace @calcom/api dev` should start the server
{% endhint %}

Open [http://localhost:3002](http://localhost:3002/) with your browser to see the result.

If you wish to test how API works locally, please [check out our guide here](/docs/how-to-guides/how-to-test-api-in-a-local-instance.md).
