Deploying Twenty.com in AWS EC2

Clone the code from github

git clone https://github.com/twentyhq/twenty.git

Prerequisites in our machine

  • Git

      sudo apt-get install git -y
    
  • Node v18

      curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
      source ~/.bashrc
      nvm install 18
      node --version
    
  • yarn v4

      corepack enable
      yarn init -2
      yarn --version
    
  • nvm

      curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
      source ~/.bashrc
      nvm --version
    

Place yourself at the root of the project

cd twenty

Set up PostgreSQL Database

sudo apt-get install make -y
make postgres-on-linux

Got an error

The error you are encountering indicates a GPG key issue when trying to update the package lists from the PostgreSQL repository.

To resolve this issue, you can import the missing GPG key for the PostgreSQL repository.

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 7FCC7D46ACCC4CF8
sudo apt-get update

Now, again run the same command

make postgres-on-linux

Setup environment variables

cp ./packages/twenty-front/.env.example ./packages/twenty-front/.env
cp ./packages/twenty-server/.env.example ./packages/twenty-server/.env

Installing dependencies

nvm install #recommended
nvm use #recommended

yarn

Running the project

cd packages/twenty-server
yarn nx database:init twenty-server

Start the server and the frontend

yarn nx start:dev twenty-server
yarn nx start twenty-front