Repository for deploying Retool
- Run
./install.sh
to install Docker and Docker Compose - Run
sudo docker-compose up
to start the Retool server
- Install
docker
anddocker-compose
- Provided are two convenience scripts for making it easy to install docker and docker-compose:
./get-docker.sh
and./get-docker-compose.sh
- Provided are two convenience scripts for making it easy to install docker and docker-compose:
- Run
./docker_setup
and use the default values provided- If you do not have bash, you can adapt the docker.env.template file
- Run
sudo docker-compose up
to start the Retool server - Be sure to open up port 80 and port 443 on the virtual machine's host
- Navigate to your server's ip address in a web browser to get started.
- Run
./update_retool.sh
- Alternatively, stop the server, and run
sudo docker-compose pull
and thensudo docker-compose up -d
- A helm chart is included in this repository under the ./helm directory
- The available parameters are documented using comments in the ./helm/values.yaml file
helm install ./helm
- Persistent volumes are not reliable - we recommend that a long-term installation of Retool host the database on an externally managed database like RDS. Please disable the included
postgresql
chart by settingpostgresql.enabled
tofalse
and then specifying your external database through theconfig.postgresql.*
properties.
- Navigate into the
kubernetes
directory - Copy the
retool-secrets.template.yaml
file toretool-secrets.yaml
and inside the{{ ... }}
sections, replace with a suitable base64 encoded string.- If you do not wish to add google authentication, replace the templates with an empty string.
- You will need a license key in order to proceed.
- Run
kubectl apply -f ./retool-secrets.yaml
- Run
kubectl apply -f ./retool-postgres.yaml
- Run
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_INSECURE
environment variable to 'true'
in ./retool-container.yaml
. Do this by adding the following two lines to the env
section.
- 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/
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 git
repo 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
-
Install the Heroku CLI, and login. Documentation for this can be found here: https://devcenter.heroku.com/articles/getting-started-with-nodejs#set-up
-
Clone this repo
git clone https://github.com/tryretool/retool-onpremise
-
Change the working directory to the newly cloned repository
cd ./retool-onpremise
-
Create a new Heroku app with the stack set to
container
withheroku create your-app-name --stack=container
-
Add a free database:
heroku addons:create heroku-postgresql:hobby-dev
-
In the
Settings
page of your Heroku app, add the following environment variables:NODE_ENV
- set toproduction
HEROKU_HOSTED
set totrue
JWT_SECRET
- set to a long secure random string used to sign JSON Web TokensENCRYPTION_KEY
- a long secure random string used to encrypt database credentials
-
Push the code:
git push heroku master
To lockdown the version of Retool used, just edit the first line under ./heroku/Dockerfile
to:
FROM tryretool/backend:X.XX.X
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 GET
request to /api/checkHealth
.
Create a Google oauth client using the tutorial below:
https://developers.google.com/identity/sign-in/web/devconsole-project
The Oauth Client screen should end up looking something like this:
Add the following to your docker.env
file
CLIENT_ID={YOUR_GOOGLE_CLIENT_ID}
CLIENT_SECRET={YOUR_GOOGLE_CLIENT_SECRET}
RESTRICTED_DOMAIN=yourcompany.com
Restart the server and you will have Google login for your org!
In Kubernetes, instead of editing the docker.env
file, place the base64 encoded version of these strings inside the kubernetes secrets file
Retool also supports SAML authentication schemes. Below is a guide to integrating Retool with Okta.
- Login into Okta as an admin. Make sure to use the Classic UI.
- Navigate to the
Applications
section of Okta - Create a new application using the SAML wizard. More information can be found here: https://help.okta.com/en/prod/Content/Topics/Apps/Apps_App_Integration_Wizard.htm
- When presented with the
Create a New Appication Integration
dialog, choose:- Platform:
Web
- Sign on method:
SAML 2.0
- Platform:
- You will then be directed to a 3 step wizard.
- For the first step (General Settings) , name the application 'Retool', and then press next.
- For the second step (Configure SAML):
- Single sign on URL: https://retool.yourcompany.com/saml/login
- Audience URI: retool.yourcompany.com
- Attribute Statements: Retool requires three attributes to be present:
- firstName: user.firstName
- lastName: user.lastName
- email: user.email
- Leave everything else as default. See below for an example of a valid configuration.
- For the third step
- Check 'I'm an Okta customer adding an internal app"
- Check "This is an internal app that we have created"
- Click 'Finish'
- The last step will be to provide the Retool instance with the Identity Provider metadata. To do this, press the 'View Setup Instructions' button. A new page with IDP metadata will appear. Copy the XML at the bottom of the page, and then:
- If you are using the
docker-compose
setup, add the following line to yourdocker.env
file. The XML content will contain multiple lines, so make sure to remove all line endings so that the entire XML string is one line in thedocker.env file
SAML_IDP_METADATA=<?xml version="1.0" encoding="UTF-8"?>...</md:EntityDescriptor>
- If you are using Heroku to deploy Retool, add a new environment variable called
SAML_IDP_METADATA
with the value of the XML document. No further steps are required.
- If you are using the
To disable the use of email + password sign-in, define the RESTRICTED_DOMAIN
environment variable. For example, using the docker.env
file, use this:
RESTRICTED_DOMAIN=yourcompany.com
Note that, if you are using this in conjuction with Google login, Retool will compare the value supplied to RESTRICTED_DOMAIN
with the domain of users that attempt to authenticate with Google SSO and reject accounts from different domains.
- On Kubernetes, I get the error
SequelizeConnectionError: password authentication failed for user "..."
- Make sure that the secrets that you encoded in base64 don't have trailing whitespace! You can use
kubectl exec printenv
to help debug this issue.
- Make sure that the secrets that you encoded in base64 don't have trailing whitespace! You can use
- I can't seem to login?
- If you have not enabled SSL yet, you will need to add the line
COOKIE_INSECURE=true
to yourdocker.env
file / environment configuration so that the authentication cookies can be sent over http.
- If you have not enabled SSL yet, you will need to add the line