---
sidebar_position: 0
slug: '/'
sidebar_custom_props:
  icon: TbBolt
---

# Local Setup

## Quickstart CLI

We built a CLI to guide you through the different options.

If you prefer to have more control and do things manually, go through the Docker section below.

Otherwise run the following command to get started:
```
npx twenty-cli
```


## Docker

### 1. Pre-requisites

Make sure to have the latest Docker and Docker-compose versions installed on your computer.

You can run `docker-compose --version` and `docker --version` to check they are installed.

### 2. Git clone
`git clone git@github.com:twentyhq/twenty.git`

### 3. Setup env variables

`cp ./infra/dev/.env.example ./infra/dev/.env` and fill with values
`cp ./front/.env.example ./front/.env` and fill with values
`cp ./server/.env.example ./server/.env` and fill with values

### 4. Build

We provide a containerized environment with Docker and orchestrated with docker-compose.
This install will also provision a postgres container out of the box.

The configuration is stored `infra/dev` folder. 

```
cd infra/dev
make build
```

### 5. Auth setup

Right now the only way to authenticate yourself is to setup Google Sign-in in `server/.env`
We will add an easier option soon.

### 6. Migrate & seed

Before running the project, we need to apply database init and migrations and run the seed.

Always in the `infra/dev` folder.

Run the containers:
```
make up
```

Generate database init and migrations:
```
make server-prisma-migrate
```

Generate prisma client
```
make server-prisma-generate-client
```

Seed the database:
```
make server-prisma-seed
```

### 7. Start

Once this is completed you can run the project with the following commands:

front:
```
make front-start
```

server:
```
make-server start
```

- front available on: http://localhost:3001
- server available on: http://localhost:3000/healthz
- postgres: available on http://localhost:5432 that should contain `twenty` database


### 8. Development

Documented [here](../development/workflows.mdx)

## Without Docker (Not recommended)

While Docker is the recommended way to run Twenty, you might want to keep a light install.

### 1. Pre-requisites
You need to have git, node and npm install on your computer.
You also need to bring your own Postgres database.

### 2. Git clone
`git clone git@github.com:twentyhq/twenty.git`

### 3. Setup env variables
`cp ./infra/dev/.env.example ./infra/dev/.env` and fill with values 
Most default value should work out of the box, but don't forget to update the database connection string.

### 4. Build
On the frontend:
```
cd front
yarn
```

On the server side:
```
cd server
yarn
yarn prisma:migrate
```
You can also add `yarn prisma:seed` to seed the database with mock data.

### 5. Auth Setup
Right now the only way to authenticate yourself is to setup Google Sign-in in `server/.env`
We will add an easier option soon.

### 6. Start
On the frontend:
```
cd front
yarn start
```
On the server side:
```
cd server
yarn start
```
