> ## Documentation Index
> Fetch the complete documentation index at: https://cubed3-pavel-claude-gallant-heisenberg-uomyfz.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Import a GitHub repository

> This guide walks you through setting up Cube Cloud, importing a GitHub repository with an existing Cube project, and connecting to your database.

## Step 1: Create an account

Navigate to [cubecloud.dev](https://cubecloud.dev/), and create a new Cube Cloud
account.

## Step 2: Create a new Deployment

Click **Create Deployment**. This is the first step in the deployment
creation. Give it a name and select the cloud provider and region of your
choice.

<div style={{ textAlign: "center" }}>
  <img alt="Cube Cloud Create Deployment Screen" src="https://cubedev-blog-images.s3.us-east-2.amazonaws.com/f5b73cc7-ac72-49ff-a3cd-491c6ab89bbc.png" style={{ border: "none" }} width="100%" />
</div>

<Info>
  Microsoft Azure is available on [Enterprise plan](https://cube.dev/pricing).
  [Contact us](https://cube.dev/contact) for details.
</Info>

## Step 3: Import repository from GitHub

Click **Import from a GitHub repository** and complete any requested GitHub
authorization. After authorization, you should see this screen:

<div style={{ textAlign: "center" }}>
  <img alt="Cube Cloud Import from GitHub screen" src="https://ucarecdn.com/2380b363-8f8b-4838-8914-9d7aa59929b2/" style={{ border: "none" }} width="100%" />
</div>

Select the **account that owns the repository** (your personal account or
organization). If it is missing, choose **Add new organization** in the account
selector to open GitHub's app installation dialog. Install the Cube Cloud GitHub
app on that account and grant it access to the repository. Complete any required
organization-owner approval before selecting the repository. See
[GitHub App permissions][ref-continuous-deployment] for access requirements and
[creating a repository][ref-create-repository] for the new-repository flow.

Select your repository and the desired branch to use as the default. If the
repository is a monorepo, you should also provide the path to the Cube project
within it. Deployments connected to a Git monorepo will trigger a rebuild
**only** when committed files begin with the provided path.

## Step 4: Connect your Database

Enter your credentials to connect to your database. Check the [connecting to
databases][link-connecting-to-databases] guide for more details.

<Info>
  Want to use a sample database instead? We also have a sample database where you
  can try out Cube Cloud:

  <br />

  | Field | Value |
  | - | - |
  | Host | `demo-db.cube.dev` |
  | Port | `5432` |
  | Database | `ecom` |
  | Username | `cube` |
  | Password | `12345` |
</Info>

<div style={{ textAlign: "center" }}>
  <img alt="Cube Cloud Setup Database Screen" src="https://cubedev-blog-images.s3.us-east-2.amazonaws.com/1375f9f1-0860-412a-a436-e2e775ec10fa.png" style={{ border: "none" }} width="100%" />
</div>

In the UI it'll look exactly like the image below.

<div style={{ textAlign: "center" }}>
  <img alt="Cube Cloud Setup Database Screen" src="https://cubedev-blog-images.s3.us-east-2.amazonaws.com/031bb948-d706-412c-b714-5bf28df01312.png" style={{ border: "none" }} width="100%" />
</div>

If you run into issues here, make sure to allow the Cube Cloud IPs to access
your database. This means you need to enable these IPs in your firewall. If you
are using AWS, this would mean adding a security group with allowed IPs.

## Step 5: Generate the Data Model

Step four in this case consists of generating data models. Start by selecting
the database tables to generate the data models from, then
hit **Generate**.

<div style={{ textAlign: "center" }}>
  <img alt="Cube Cloud Setup Database Screen" src="https://cubedev-blog-images.s3.us-east-2.amazonaws.com/a906434b-c4da-414a-adb3-f010b1fa45d1.png" style={{ border: "none" }} width="100%" />
</div>

Cube Cloud will generate the data models and spin up your Cube deployment. With
this, you're done. You've created a Cube deployment, configured a database
connection, and generated data models!

<div style={{ textAlign: "center" }}>
  <img alt="Cube Cloud Setup Database Screen" src="https://cubedev-blog-images.s3.us-east-2.amazonaws.com/b6addada-cc77-4940-aa0c-a0a9c3df6fd1.png" style={{ border: "none" }} width="100%" />
</div>

You're ready for the last step, running queries in the Playground.

## Step 6: Try out Cube Cloud

Now you can navigate to Playground to try out your queries or connect your
application to Cube Cloud API.

<div style={{ textAlign: "center" }}>
  <img alt="Cube Cloud Playground" src="https://ucarecdn.com/43bc545a-3c77-42e4-a9db-7c5188fe610e/" style={{ border: "none" }} width="100%" />
</div>

[github]: https://github.com

[link-connecting-to-databases]: /admin/connect-to-data/data-sources

[ref-continuous-deployment]: /admin/deployment/continuous-deployment#github-app-permissions

[ref-create-repository]: /admin/deployment/continuous-deployment#creating-a-new-repository


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.