Deploying ToolJet on Amazon AMI
You can effortlessly deploy Amazon Elastic Compute Cloud Service (EC2) by utilizing a CloudFormation template. This template will deploy all the services required to run ToolJet on AWS AMI instances.
To use ToolJet AI features in your deployment, make sure to whitelist https://api-gateway.tooljet.ai and https://python-server.tooljet.ai in your network settings.
You should setup a PostgreSQL database manually to be used by ToolJet. We recommend using an RDS PostgreSQL database. You can find the system requirements here.
ToolJet runs with built-in Redis for multiplayer editing and background jobs. When running separate worker containers or multi-pod setup, an external Redis instance is required for job queue coordination.
Deploy using CloudFormation
To deploy all the services at once, simply employ the following template:
curl -LO https://tooljet-deployments.s3.us-west-1.amazonaws.com/cloudformation/EC2-cloudfomration.yml
Deploy using Terraform
Use this terraform script to quickly spin up a vm.
- Deploy on AWS EC2 Using AMI
Follow the steps below to deploy ToolJet on AWS AMI instances.
-
Setup a PostgreSQL database and make sure that the database is accessible from the EC2 instance.
-
Login to your AWS management console and go to the EC2 management page.
-
Under the Images section, click on the AMIs button.
-
Find the ToolJet version you want to deploy. Now, from the AMI search page, select the search type as "Public Images" and input the version you'd want
AMI Name : tooljet_vX.X.X.ubuntu_bionicin the search bar. -
Select ToolJet's AMI and bootup an EC2 instance.
Creating a new security group is recommended. For example, if the installation should receive traffic from the internet, the inbound rules of the security group should look like this:protocol port allowed_cidr tcp 22 your IP tcp 80 0.0.0.0/0 tcp 443 0.0.0.0/0 -
Once the instance boots up, SSH into the instance by running
ssh -i <path_to_pem_file> ubuntu@<public_ip_of_the_instance>. -
Switch to the app directory by running
cd ~/app.
Modify the contents of the.envfile. ( Eg:vim .env)The default
.envfile looks like this:LOCKBOX_MASTER_KEY=
SECRET_KEY_BASE=
PG_DB=
PG_USER=
PG_HOST=
PG_PASS=
TOOLJET_DB=
TOOLJET_DB_HOST=
TOOLJET_DB_USER=
TOOLJET_DB_PASS=Read environment variables reference.
SSL Configuration for AWS RDS PostgreSQL
warningImportant: When connecting to PostgreSQL 16.9 on AWS RDS with SSL enabled, you need to configure SSL certificates. The
NODE_EXTRA_CA_CERTSenvironment variable is critical for resolving SSL certificate chain issues and for connecting to self-signed HTTPS endpoints.For AWS RDS PostgreSQL connections, first download the certificate bundle:
# Create directory and download certificate
sudo mkdir -p /home/ubuntu/certs/
cd /home/ubuntu/certs/
sudo wget https://truststore.pki.rds.amazonaws.com/global/global-bundle.pem
sudo chmod 644 /home/ubuntu/certs/global-bundle.pemThen add these variables to your
.envfile:PG_HOST=your-rds-endpoint.region.rds.amazonaws.com
PGSSLMODE=require
NODE_EXTRA_CA_CERTS=/home/ubuntu/certs/global-bundle.pemAfter updating the
.envfile, restart the application with./setup_app. -
TOOLJET_HOSTenvironment variable determines where you can access the ToolJet client. It can either be the public ipv4 address of your instance or a custom domain that you want to use.Examples:
TOOLJET_HOST=http://12.34.56.78orTOOLJET_HOST=https://yourdomain.comorTOOLJET_HOST=https://tooljet.yourdomain.cominfoWe use a lets encrypt plugin on top of nginx to create TLS certificates on the fly.
infoPlease make sure that
TOOLJET_HOSTstarts with eitherhttp://orhttps:// -
Once you've configured the
.envfile, run./setup_app. This script will install all the dependencies of ToolJet and then will start the required services. -
If you've set a custom domain for
TOOLJET_HOST, add aA recordentry in your DNS settings to point to the IP address of the EC2 instance. -
You're all done, ToolJet client would now be served at the value you've set in
TOOLJET_HOST.
Deploying ToolJet Database
ToolJet AMI comes inbuilt with PostgREST. If you intend to use this feature, you'd only have to setup the environment variables in ~/app/.env file and run ./setup_app script.
You can learn more about this feature here.
References
Workflows
ToolJet Workflows allows users to design and execute complex, data-centric automations using a visual, node-based interface. This feature enhances ToolJet's functionality beyond building secure internal tools, enabling developers to automate complex business processes.
For users migrating from Temporal-based workflows, please refer to the Workflow Migration Guide.
Enabling Workflow Scheduling
To activate workflow scheduling, set the following environment variables:
# Worker Mode (required)
# Set to 'true' to enable job processing
# Set to 'false' or unset for HTTP-only mode (scaled deployments)
WORKER=true
# Workflow Processor Concurrency (optional)
# Number of workflow jobs processed concurrently per worker
# Default: 5
TOOLJET_WORKFLOW_CONCURRENCY=5
Environment Variable Details:
- WORKER (required): Enables job processing. Set to
trueto activate workflow scheduling - TOOLJET_WORKFLOW_CONCURRENCY (optional): Controls the number of workflow jobs processed concurrently per worker instance. Default is 5 if not specified
External Redis Requirement: When running separate worker containers or multiple instances, an external stateful Redis instance is required for job queue coordination. The built-in Redis only works when the server and worker are in the same container instance (single instance deployment). Configure the Redis connection using the following environment variables:
REDIS_HOST=localhost- Default: localhostREDIS_PORT=6379- Default: 6379REDIS_USERNAME=- Optional: Redis username (ACL)REDIS_PASSWORD=- Optional: Redis passwordREDIS_DB=0- Optional: Redis database number (default: 0)REDIS_TLS=false- Optional: Enable TLS/SSL (set to 'true')
Note: After updating the .env file, restart the server using ./setup_app.
Upgrading to the Latest LTS Version
Users on versions earlier than v2.23.0-ee2.10.2 must first upgrade to this version before proceeding to the LTS version.
New LTS versions are released every 3-5 months with an end-of-life of atleast 18 months. To check the latest LTS version, visit the ToolJet Docker Hub page. The LTS tags follow a naming convention with the prefix LTS- followed by the version number, for example tooljet/tooljet:ee-lts-latest.
Since ToolJet is deployed using an AMI (Amazon Machine Image), upgrading to a new LTS version requires launching a new EC2 instance with the updated AMI instead of upgrading in place.
Steps to Upgrade
- Backup Your Data
Perform a comprehensive backup of your PostgreSQL database to prevent data loss. - Copy the .env File from the old Instance
Before stopping the old instance, copy the.envfile and store it safely. - Stop the old EC2 Instance
- To prevent conflicts, stop the old EC2 instance before proceeding with the new deployment.
- Ensure that the old instance remains stopped while setting up the new one.
- Launch a New EC2 Instance with the Latest AMI
- Go to the AWS AMI dashboard and find the latest ToolJet AMI.
- Launch a new EC2 instance using this AMI.
- Configure security group rules as needed.
- Transfer the .env File to the New Instance
Upload the saved.envfile to the appropriate directory on the new instance. - Start the Application
SSH into the new instance, navigate to the app directory, and run the setup script:cd ~/app
./setup_app - Terminate the Old EC2 Instance
After verifying that ToolJet is running correctly on the new instance, terminate the old EC2 instance to avoid unnecessary costs.
If you have any questions feel free to join our Slack Community or send us an email at [email protected].