Ubuntu
The following guide is intended for contributors to set-up ToolJet locally. If you're interested in self-hosting ToolJet, please refer to the Setup section.
Follow these steps to setup and run ToolJet on Ubuntu. Open terminal and run the commands below.
Setting up
-
Set up the environment
1.1 Install NVM
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
Use the command to load NVM:
source ~/.nvm/nvm.sh
Close and reopen your terminal to start using nvm
nvm install 18.18.2
Ensure you have the correct version of npm, or it will cause an error about fsevents.
npm i -g [email protected]
1.2 Install Postgres
sudo apt install postgresql postgresql-contrib
sudo apt-get install libpq-dev1.3 Install PostgREST (optional)
infoRequired only if ToolJet Database is being used.
Please use PostgREST version 10.1.1.x
Please follow the installation PostgREST guide
-
Setup the repository:
2.1 Fork the repository:
Go to the ToolJet GitHub repository, click on the Fork button to create a copy of the repository under your own GitHub account.
2.2 Clone your forked repository:
After forking, clone the forked repository to your local machine using the URL of your forked repo.
git clone https://github.com/<your-username>/ToolJet.git
-
Set up environment variables
Create a
.env
file by copying.env.example
. More information on the variables that can be set is given in the environment variables referencecp .env.example .env
-
Populate the keys in the env file
infoSECRET_KEY_BASE
requires a 64 byte key. (If you haveopenssl
installed, runopenssl rand -hex 64
to create a 64 byte secure random key)LOCKBOX_MASTER_KEY
requires a 32 byte key. (Runopenssl rand -hex 32
to create a 32 byte secure random key)Example:
cat .env
TOOLJET_HOST=http://localhost:8082
LOCKBOX_MASTER_KEY=1d291a926ddfd221205a23adb4cc1db66cb9fcaf28d97c8c1950e3538e3b9281
SECRET_KEY_BASE=4229d5774cfe7f60e75d6b3bf3a1dbb054a696b6d21b6d5de7b73291899797a222265e12c0a8e8d844f83ebacdf9a67ec42584edf1c2b23e1e7813f8a3339041 -
Install and build dependencies
npm install
npm install --prefix server
npm install --prefix frontend
npm run build:pluginsNOTE: If the
npm run build:plugins
command fails due to some packages are missing, try running the following command to install the necessary packages:sudo apt install build-essential
then proceed tonpm run build:plugins
step again -
Set up database
npm run --prefix server db:create
npm run --prefix server db:resetinfoIf at any point you need to reset the database, use this command
npm run --prefix server db:reset
-
Run plugins compilation in watch mode
cd ./plugins && npm start
-
Run the server
cd ./server && npm run start:dev
-
Run the client
cd ./frontend && npm start
The client will start running on the port 8082, you can access the client by visiting: http://localhost:8082
-
Create login credentials
Visiting https://localhost:8082 should redirect you to the login page, click on the signup link and enter your email. The emails sent by the server in development environment are captured and are opened in your default browser. Click the invitation link in the email preview to setup the account.
Running tests
Test config requires the presence of .env.test
file at the root of the project.
To run the unit tests
npm run --prefix server test
To run e2e tests
npm run --prefix server test:e2e
To run a specific unit test
npm run --prefix server test <path-to-file>