Mostly for contributors or curious developers
Follow this guide if you would like to setup the project locally to contribute.
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.
In your terminal, run the following command.
If you haven't already set up SSH keys, you can learn how to do so here.
git clone [email protected]:twentyhq/twenty.git
cd twenty
You should run all commands in the following steps from the root of the project.
You can access the database at localhost:5432, with user twenty
and password twenty
.
Option 1: 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;" -c "CREATE USER twenty PASSWORD 'twenty';" -c "ALTER ROLE twenty superuser;"
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
Twenty requires a redis cache to provide the best performances
Option 1: To provision your Redis locally: Use the following link to install Redis on your Linux machine: Redis Installation
Option 2: If you have docker installed:
make redis-on-docker
Use environment variables or .env
files to configure your project.
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
To build Twenty server and seed some data into your database, run the following command:
yarn
Start your redis server:
Depending on your Linux distribution, Redis server might be started automatically. If not, check the Redis installation guide for your distro.
Setup 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
Twenty's server will be up and running at http://localhost:3000. The GraphQL API can be accessed at http://localhost:3000/graphql, and the REST API can be reached at http://localhost:3000/rest.
Twenty's frontend will be running at http://localhost:3001. Just log in using the seeded demo account: [email protected]
(password: Applecar2025
) to start using Twenty.
This is due to the line break characters of Windows and the git configuration. Try running:
git config --global core.autocrlf false
Then delete the repository and clone it again.
During Twenty installation, you need to provision your postgres database with the right schemas, extensions, and users.
If you're successful in running this provisioning, you should have default
and metadata
schemas in your database.
If you don't, make sure you don't have more than one postgres instance running on your computer.
You have to build the package twenty-emails
before running the initialization of the database with npx nx run twenty-emails:build
Make sure to run yarn in the root directory and then run npx nx server:dev twenty-server
. If this still doesn't work try building the missing package manually.
This should work out of the box with the eslint extension installed. If this doesn't work try adding this to your vscode setting (on the dev container scope):
npx nx start
or npx nx start twenty-front
, Out of memory error is thrownIn packages/twenty-front/.env
uncomment VITE_DISABLE_TYPESCRIPT_CHECKER=true
and VITE_DISABLE_ESLINT_CHECKER=true
to disable background checks thus reducing amount of needed RAM.
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
}
As an open-source company, we welcome contributions through Github. Help us keep it up-to-date, accurate, and easy to understand by getting involved and sharing your ideas!