Skip to main content
Header

Prerequisites

  • Linux and MacOS
  • Windows (WSL)
Before you can install and use Twenty, make sure you install the following on your computer:
npm won’t work, you should use yarn instead. Yarn is now shipped with Node.js, so you don’t need to install it separately. You only have to run corepack enable to enable Yarn if you haven’t done it yet.

Step 1: Git Clone

In your terminal, run the following command.

Step 2: Position yourself at the root

cd twenty
You should run all commands in the following steps from the root of the project.

Step 3: Set up a PostgreSQL Database

  • Linux
  • Mac OS
  • Windows (WSL)
Option 1 (preferred): To provision your database locally: Use the following link to install Postgresql on your Linux machine: Postgresql Installation
  psql postgres -c "CREATE DATABASE \"default\";" -c "CREATE DATABASE test;"
Note: You might need to add sudo -u postgres to the command before psql to avoid permission errors.Option 2: If you have docker installed:
  make postgres-on-docker
You can now access the database at localhost:5432, with user postgres and password postgres .

Step 4: Set up a Redis Database (cache)

Twenty requires a redis cache to provide the best performance
  • Linux
  • Mac OS
  • Windows (WSL)
Option 1: To provision your Redis locally: Use the following link to install Redis on your Linux machine: Redis InstallationOption 2: If you have docker installed:
  make redis-on-docker
If you need a Client GUI, we recommend redis insight (free version available)

Step 5: Setup environment variables

Use environment variables or .env files to configure your project. More info here Copy the .env.example files in /front and /server:
cp ./packages/twenty-front/.env.example ./packages/twenty-front/.env
cp ./packages/twenty-server/.env.example ./packages/twenty-server/.env

Step 6: Installing dependencies

To build Twenty server and seed some data into your database, run the following command:
yarn
Note that npm or pnpm won’t work

Step 7: Running the project

  • Linux
  • Mac OS
  • Windows (WSL)
Depending on your Linux distribution, Redis server might be started automatically. If not, check the Redis installation guide for your distro.
Set up your database with the following command:
npx nx database:reset twenty-server
Start the server, the worker and the frontend services:
npx nx start twenty-server
npx nx worker twenty-server
npx nx start twenty-front
Alternatively, you can start all services at once:
npx nx start

Step 8: Use Twenty

Frontend Twenty’s frontend will be running at http://localhost:3001. You can log in using the default demo account: tim@apple.dev (password: tim@apple.dev) Backend

Troubleshooting

If you encounter any problem, check Troubleshooting for solutions.