Deploying Retool On Prem
Retool lets you build custom internal tools in minutes.
Deploying Retool on-premise ensures that all access to internal data is managed within your own cloud environment. You also have the flexibility to control how Retool is setup within your infrastructure, configure logging, and enable custom SAML SSO using providers like Okta and Active Directory.
Get set up in 15 minutes by deploying Retool on a single machine.
Spin up a new EC2 instance. If using AWS, use the following steps: 1. Click Launch Instance from the EC2 dashboard. 1. Click Select for an instance of Ubuntu
16.04or higher. 1. Select an instance type of at least
t2.mediumand click Next. 1. Ensure you select the VPC that also includes the databases / API’s you will want to connect to and click Next. 1. Increase the storage size to
60GB or higher and click Next. 1. Optionally add some Tags (e.g.
app = retool) and click Next. This makes it easier to find if you have a lot of instances. 1. Set the network security groups for ports
80,
443,
22and
3000, with sources set to
0.0.0.0/0and
::/0, and click Review and Launch. We need to open ports
80(http) and
443(https) so you can connect to the server from a browser, as well as port
22(ssh) so that you can ssh into the instance to configure it and run Retool. By default on a vanilla EC2, Retool will run on port
3000. 1. On the Review Instance Launch screen, click Launch to start your instance. 1. If you're connecting to internal databases, whitelist the VPS's IP address in your database. 1. From your command line tool, SSH into your EC2 instance. 1. Run the command
git clone https://github.com/tryretool/retool-onpremise.git. 1. Run the command
cd retool-onpremiseto enter the cloned repository's directory. 1. Run
./install.shto install Docker and Docker Compose. 1. In your
docker.env(this file is only created after running
./install.sh) add the following: ``` # License key granted to you by Retool LICENSEKEY=YOURLICENSE_KEY
# This is necessary if you plan on logging in before setting up https COOKIE_INSECURE=true ```
docker-compose up -dto start the Retool server.
sudo docker-compose psto make sure all the containers are up and running.
3000.
Just use the Deploy to Heroku button below!
To update a Heroku deployment that was created with the button above, you may first set up a
gitrepo to push to Heroku
$ heroku login $ git clone https://github.com/tryretool/retool-onpremise $ cd retool-onpremise $ heroku git:remote -a YOUR_HEROKU_APP_NAME
To update Retool (this will automatically fetch the latest version of Retool)
$ git commit --allow-empty -m 'Redeploying' $ git push heroku master
Alternatively, you may follow the following steps to deploy to Heroku
git clone https://github.com/tryretool/retool-onpremise
cd ./retool-onpremise
containerwith
heroku create your-app-name --stack=container
heroku addons:create heroku-postgresql:hobby-dev
Settingspage of your Heroku app, add the following environment variables:
NODE_ENV- set to
production
HEROKU_HOSTEDset to
true
JWT_SECRET- set to a long secure random string used to sign JSON Web Tokens
ENCRYPTION_KEY- a long secure random string used to encrypt database credentials
git push heroku master
To lockdown the version of Retool used, just edit the first line under
./heroku/Dockerfileto:
FROM tryretool/backend:X.XX.X
git clone https://github.com/tryretool/retool-onpremise
cd ./retool-onpremise
aptible apps:create your-app-name
aptible db:create your-database-name --type postgresql
EXPIRED-LICENSE-KEY-TRIALto the license key provided to you.
aptible config:set --app your-app-name \ POSTGRES_DB=your-db \ POSTGRES_HOST=your-db-host \ POSTGRES_USER=your-user \ POSTGRES_PASSWORD=your-db-password \ POSTGRES_PORT=your-db-port \ POSTGRES_SSL_ENABLED=true \ FORCE_SSL=true \ NODE_ENV=production \ JWT_SECRET=$(cat /dev/urandom | base64 | head -c 256) \ ENCRYPTION_KEY=$(cat /dev/urandom | base64 | head -c 64) \ LICENSE_KEY=EXPIRED-LICENSE-KEY-TRIAL
git remote add aptible your-git-url
git push aptible master
Just use the Deploy to Render button below! Here are some docs on deploying Retool with Render.
Deploy Retool on a managed service. We've provided some starter template files for Cloudformation setups (ECS + Fargate), Kubernetes, and Helm.
We provide a template file for you to get started deploying on ECS.
EC2 Linux + Networkingas the cluster template.
retool.yamlfile.
tryretool/backend:latest
Eventstab in Cloudformation
CREATE_COMPLETEstatus.
We provide Fargate template files supporting public and private subnets.
Networking Only (Powered by AWS Fargate)as the cluster template.
.yamlfile.
tryretool/backend:latest
Eventstab in Cloudformation
kubernetesdirectory
retool-secrets.template.yamlfile to
retool-secrets.yamland inside the
{{ ... }}sections, replace with a suitable base64 encoded string.
echo -n | base64in the command line. Be sure to add the
-ncharacter, as it removes the trailing newline character from the encoding.
kubectl apply -f ./retool-secrets.yaml
kubectl apply -f ./retool-postgres.yaml
kubectl apply -f ./retool-container.yaml
For ease of use, this will create a postgres container with a persistent volume for the storage of Retool data. We recommend that you use a managed database service like RDS as a long-term solution. The application will be exposed on a public ip address on port 3000 - we leave it to the user to handle DNS and SSL.
Please note that by default Retool is configured to use Secure Cookies - that means that you will be unable to login unless https has been correctly setup.
To force Retool to send the auth cookies over HTTP, please set the
COOKIE_INSECUREenvironment variable to
'true'in
./retool-container.yaml. Do this by adding the following two lines to the
envsection.
- name: COOKIE_INSECURE value: 'true'
Then, to update the running deployment, run
$ kubectl apply -f ./retool-container.yaml
To update Retool on Kubernetes, you can use the following command:
$ kubectl set image deploy/api api=tryretool/backend:X.XX.X
The list of available version numbers for X.XX.X are available here: https://updates.tryretool.com/
helm repo add retool https://charts.retool.com helm install my-retool retool/retool
See https://github.com/tryretool/retool-helm for full Helm chart documentation and instructions.
For details on additional features like SAML SSO, gRPC, custom certs, and more, visit our docs.
You can set environment variables to enable custom functionality like managing secrets, customizing logs, and much more. For a list of all environment variables visit our docs.
Retool also has a health check endpoint that you can set up to monitor liveliness of Retool. You can configure your probe to make a
GETrequest to
/api/checkHealth.
SequelizeConnectionError: password authentication failed for user "..."
kubectl exec printenvto help debug this issue.
echo -n | base64in the command line. The
-ncharacter removes the trailing newline character from the encoding.
COOKIE_INSECURE=trueto your
docker.envfile / environment configuration so that the authentication cookies can be sent over http. Make sure to run
sudo docker-compose up -dafter modifying the
docker.envfile.
TypeError: Cannot read property 'licenseVerification' of nullor
TypeError: Cannot read property 'name' of null
Releases notes can be found on updates.retool.com.
Below is a cheatsheet for useful Docker commands. Note that you may need to prefix them with
sudo.
| Command | Description | | ----------------------------|-------------------------------------------------------------------------------------------------------------------------------| |
docker-compose up -d| Builds, (re)creates, starts, and attaches to containers for a service.
-dallows containers to run in background (detached). | |
docker-compose down| Stops and remove containers and networks | |
docker-compose stop| Stops containers, but does not remove them and their networks | |
docker ps -a| Display all Docker containers | |
docker-compose ps -a| Display all containers related to images declared in the
docker-composefile. |
docker logs -f| Stream container logs to stdout | |
docker exec -it psql -U -W| Runs
psqlinside a container | |
docker kill $(docker ps -q)| Kills all running containers | |
docker rm $(docker ps -a -q)| Removes all containers and networks | |
docker rmi -f $(docker images -q)| Removes (and un-tags) all images from the host | |
docker volume rm $(docker volume ls -q)| Removes all volumes and completely wipes any persisted data |