ToolJet/docs/versioned_docs/version-3.0.0-LTS/setup/ec2.md

132 lines
5.6 KiB
Markdown
Raw Normal View History

2024-11-10 22:27:25 +00:00
---
id: ec2
title: AWS EC2
---
# Deploying ToolJet on Amazon EC2
:::warning
To enable ToolJet AI features in your ToolJet deployment, whitelist https://api-gateway.tooljet.ai.
:::
2024-11-10 22:27:25 +00:00
:::info
You should setup a PostgreSQL database manually to be used by the ToolJet server.
:::
2024-11-10 22:27:25 +00:00
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.
1. Setup a PostgreSQL database and make sure that the database is accessible from the EC2 instance.
2. Login to your AWS management console and go to the EC2 management page.
3. Under the **Images** section, click on the **AMIs** button.
4. Find the [ToolJet version](/docs/setup/choose-your-tooljet) 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.
5. Select ToolJet's AMI and bootup an EC2 instance. <br/>
2024-11-10 22:27:25 +00:00
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 |
6. Once the instance boots up, SSH into the instance by running `ssh -i <path_to_pem_file> ubuntu@<public_ip_of_the_instance>`.
2024-11-10 22:27:25 +00:00
7. Switch to the app directory by running `cd ~/app`. <br/> Modify the contents of the `.env` file. ( Eg: `vim .env` )
2024-11-10 22:27:25 +00:00
The default `.env` file looks like this:
```bash
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=
2024-11-10 22:27:25 +00:00
```
Read **[environment variables reference](/docs/setup/env-vars)**
:::info
If 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.
:::
8. `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.
2024-11-10 22:27:25 +00:00
Examples:
`TOOLJET_DB_HOST=http://12.34.56.78` or
`TOOLJET_DB_HOST=https://yourdomain.com` or
`TOOLJET_DB_HOST=https://tooljet.yourdomain.com`
2024-11-10 22:27:25 +00:00
:::info
We use a [lets encrypt](https://letsencrypt.org/) plugin on top of nginx to create TLS certificates on the fly.
:::
:::info
Please make sure that `TOOLJET_DB_HOST` starts with either `http://` or `https://`
2024-11-10 22:27:25 +00:00
:::
9. 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.
10. If you've set a custom domain for `TOOLJET_HOST`, add a `A record` entry in your DNS settings to point to the IP address of the EC2 instance.
12. 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.
2024-11-13 07:32:52 +00:00
You can learn more about this feature [here](/docs/tooljet-db/tooljet-database).
2024-11-10 22:27:25 +00:00
[docs]: AI Release (#11965) * [docs]: Add Marketplace Plugin Anthropic * [docs]: Add Marketplace Plugin Gemini * Update Operations * Update Operation * [docs]: Add Marketplace Plugin Hugging Face * Update Intro Pata * Update Intro Para * Add Model Example and Info on Inference API * Update intro para * Update Model Example * Grammatical Improvements * Grammatical Updates * Grammar * Update example * [docs]: Add Marketplace Plugin Mistral AI * Update models * [docs]: Add Marketplace Plugin Qdrant * Update Models in Beta * Update Models in V3 * [docs]: Add Marketplace Plugin Cohere * [docs]: Add Marketplace OpenAI Embedding * Update model in beta * Update model LTS * [docs]:AI Whitelist info in setups * update: ecs and cloud run * [docs] added chromadb * [docs] updated digital-ocean * [docs] updated k8s * Made changes in the docs for adding chromadb * [dos]: ToolJet AI license update * fix: formatting * fix: formatting * [docs]: Add Chat Component * Update Example and Add Info Box * [docs]: updated pinecone plugin * Update SS * [docs]: ToolJet AI * Update available model link * Fix typo * Add advanced parameters table * [docs] added AI_GATEWAY_URL * [fix] indentation * update: AI credits * fix: typo * Chat Component Properties * update: improved doc * CSA and Replicate to LTS * [docs] updated kubernetes and helm for Chromadb * [docs]: Add Marketplace Plugin Qdrant * [docs]: Add Marketplace Plugin Qdrant * Add Markdown * [docs]: Add Marketplace Plugin Weviate DB * Update qdrant beta * Update qdrant LTS * Update sidebars.js * Update sidebars.js * Update marketplace_overview beta * Update marketplace_overview.md * Update marketplace_overview.md * Update Response * formatting updates * Parameter Definition Updates * Update intro qdrant.md Beta * Update intro qdrant.md LTS * update local host * update: added to beta * fix: fomatting * fix: formatting * fix: doc * fix: review * update pritesh feedback * fix: typo * Mansukha Feedback Updates * Remove required and optional emoji * fix: updates * fix: updates * fix: review * minor update in the markdown docs * fix: plans * update: added screenshots * update: added docs to beta * add minor changes --------- Co-authored-by: Akshat Virmani <akshatvirmani93@gmail.com> Co-authored-by: PriteshKiri <pritesh.d.kiri@gmail.com> Co-authored-by: Souvik <psouvik260@gmail.com> Co-authored-by: Adish M <adish.madhu@gmail.com> Co-authored-by: Pritesh Kiri <77957844+PriteshKiri@users.noreply.github.com> Co-authored-by: Vaishnavi Joshi <vj.codes29@gmail.com> Co-authored-by: Karan Rathod <karan.altcampus@gmail.com>
2025-02-11 07:32:43 +00:00
2024-11-10 22:27:25 +00:00
## Upgrading to the Latest LTS Version
:::note
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](https://hub.docker.com/r/tooljet/tooljet/tags) page. The LTS tags follow a naming convention with the prefix `LTS-` followed by the version number, for example `tooljet/tooljet:ee-lts-latest`.
2024-11-10 22:27:25 +00:00
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.
2024-11-10 22:27:25 +00:00
#### Steps to Upgrade:
**1. Backup Your Data**
- Perform a comprehensive backup of your PostgreSQL database to prevent data loss.
**2. Copy the .env File from the old Instance**
- Before stopping the old instance, copy the `.env` file and store it safely.
**3. 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.
2024-11-10 22:27:25 +00:00
**4. Launch a New EC2 Instance with the Latest AMI**
2024-11-10 22:27:25 +00:00
- Go to the AWS EC2 dashboard and find the latest ToolJet AMI.
- Launch a new EC2 instance using this AMI.
- Configure security group rules as needed.
**5. Transfer the .env File to the New Instance**
- Upload the saved `.env` file to the appropriate directory on the new instance.
**6. Start the Application**
- SSH into the new instance, navigate to the app directory, and run the setup script:
```bash
cd ~/app
./setup_app
```
2024-11-10 22:27:25 +00:00
**7. 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.
[docs]: AI Release (#11965) * [docs]: Add Marketplace Plugin Anthropic * [docs]: Add Marketplace Plugin Gemini * Update Operations * Update Operation * [docs]: Add Marketplace Plugin Hugging Face * Update Intro Pata * Update Intro Para * Add Model Example and Info on Inference API * Update intro para * Update Model Example * Grammatical Improvements * Grammatical Updates * Grammar * Update example * [docs]: Add Marketplace Plugin Mistral AI * Update models * [docs]: Add Marketplace Plugin Qdrant * Update Models in Beta * Update Models in V3 * [docs]: Add Marketplace Plugin Cohere * [docs]: Add Marketplace OpenAI Embedding * Update model in beta * Update model LTS * [docs]:AI Whitelist info in setups * update: ecs and cloud run * [docs] added chromadb * [docs] updated digital-ocean * [docs] updated k8s * Made changes in the docs for adding chromadb * [dos]: ToolJet AI license update * fix: formatting * fix: formatting * [docs]: Add Chat Component * Update Example and Add Info Box * [docs]: updated pinecone plugin * Update SS * [docs]: ToolJet AI * Update available model link * Fix typo * Add advanced parameters table * [docs] added AI_GATEWAY_URL * [fix] indentation * update: AI credits * fix: typo * Chat Component Properties * update: improved doc * CSA and Replicate to LTS * [docs] updated kubernetes and helm for Chromadb * [docs]: Add Marketplace Plugin Qdrant * [docs]: Add Marketplace Plugin Qdrant * Add Markdown * [docs]: Add Marketplace Plugin Weviate DB * Update qdrant beta * Update qdrant LTS * Update sidebars.js * Update sidebars.js * Update marketplace_overview beta * Update marketplace_overview.md * Update marketplace_overview.md * Update Response * formatting updates * Parameter Definition Updates * Update intro qdrant.md Beta * Update intro qdrant.md LTS * update local host * update: added to beta * fix: fomatting * fix: formatting * fix: doc * fix: review * update pritesh feedback * fix: typo * Mansukha Feedback Updates * Remove required and optional emoji * fix: updates * fix: updates * fix: review * minor update in the markdown docs * fix: plans * update: added screenshots * update: added docs to beta * add minor changes --------- Co-authored-by: Akshat Virmani <akshatvirmani93@gmail.com> Co-authored-by: PriteshKiri <pritesh.d.kiri@gmail.com> Co-authored-by: Souvik <psouvik260@gmail.com> Co-authored-by: Adish M <adish.madhu@gmail.com> Co-authored-by: Pritesh Kiri <77957844+PriteshKiri@users.noreply.github.com> Co-authored-by: Vaishnavi Joshi <vj.codes29@gmail.com> Co-authored-by: Karan Rathod <karan.altcampus@gmail.com>
2025-02-11 07:32:43 +00:00
*If you have any questions feel free to join our [Slack Community](https://tooljet.com/slack) or send us an email at hello@tooljet.com.*