Deploying ToolJet on Amazon EC2
You should setup a PostgreSQL database manually to be used by the ToolJet server.
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 EC2 instances.
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
Follow the steps below to deploy ToolJet on AWS EC2 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_bionic
in 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.env
file. ( Eg:vim .env
)The default
.env
file 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
infoIf there are self signed HTTPS endpoints that ToolJet needs to connect to, please make sure that
NODE_EXTRA_CA_CERTS
environment variable is set to the absolute path containing the certificates. -
TOOLJET_DB_HOST
environment 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_DB_HOST=http://12.34.56.78
orTOOLJET_DB_HOST=https://yourdomain.com
orTOOLJET_DB_HOST=https://tooljet.yourdomain.com
infoWe use a lets encrypt plugin on top of nginx to create TLS certificates on the fly.
infoPlease make sure that
TOOLJET_DB_HOST
starts with eitherhttp://
orhttps://
-
Once you've configured the
.env
file, 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 record
entry 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.
To enable ToolJet AI features in your ToolJet deployment, whitelist api-gateway.tooljet.ai
and docs.tooljet.ai
.
Setup to Enable ToolJet AI
Build applications effortlessly with ToolJet AI, using natural language to generate and customize apps. Refer to ToolJet AI guide for more information.
Follow this guide to enable AI features in your self-hosted setup.
Deployment Steps
- Add Chroma under the services section and define volumes under the volumes section in the docker-compose.
services:
chroma:
name: chromadb
image: chromadb/chroma
ports:
- "8000:8000"
environment:
- CHROMA_HOST_PORT=8000
volumes:
- chromadb_data:/chroma
volumes:
chromadb_data:
driver: local
- Add these environment variables to the .env file in the ToolJet server.
CHROMA_DB_URL=chromadb:8000
AI_GATEWAY_URL=https://api-gateway.tooljet.ai
Upgrading to the Latest 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
.
If this is a new installation of the application, you may start directly with the latest version. This guide is not required for new installations.
Prerequisites for Upgrading to the Latest LTS Version:
-
It is crucial to perform a comprehensive backup of your database before starting the upgrade process to prevent data loss.
-
Users on versions earlier than v2.23.0-ee2.10.2 must first upgrade to this version before proceeding to the LTS version.
If you are upgrading from version v3.0.33-ee-lts to the latest LTS, please ensure that the following configuration is done, including the addition of ChromaDB to the existing setup.
If you have any questions feel free to join our Slack Community or send us an email at [email protected].