Files
twenty_crm/docs/docs/dev-docs/getting-started/local-setup.mdx

117 lines
2.4 KiB
Plaintext

---
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
### 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. Start
Always in the `infra/dev` folder:
```
make up
```
Once this is completed you should have:
- front available on: http://localhost:3001
- server available on: http://localhost:3000/health
- postgres: available on http://localhost:5432 that should contain `twenty` database
### 6. 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
npm install
```
On the server side:
```
cd server
npm install
npm run prisma:migrate
```
You can also add `npm run 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
npm run start
```
On the server side:
```
cd server
npm run start
```