Configure SSL and custom certificates
Learn how to connect to Retool with HTTPS and configure custom certificates for Docker-based deployments.
| Self-hosted Retool Availability | |||
|---|---|---|---|
| Self-hosted Edge | Generally Available | ||
| Self-hosted Stable | Generally Available | ||
Self-hosted Retool is available on an Enterprise plan only.
Docker Compose deployments of Self-hosted Retool include https-portal to automatically configure HTTPS. You can either provision a certificate with Let's Encrypt or manually add your own custom certificate.
The process for Kubernetes and other deployment types is similar to the steps for Docker Compose, but might require different settings. For example, with Kubernetes you can use Kubernetes Secrets, and with Heroku you can extend the Dockerfile to copy the certificate into the container.
https-portal requires that port 80 be available and exposed to the internet, so Retool configures this automatically. If you modify this setting, https-portal won't function correctly.
SSL with Let's Encrypt
Provisioning a certificate with Let's Encrypt is a two-step process:
- Configure DNS
- Update Docker configuration file
Configure DNS
First, set up a DNS to point retool.yourcompany.com to the Retool server. Next, open the docker.env file and update DOMAINS with the new domain.
DOMAINS=retool.yourcompany.com -> http://api:3000
Update Docker Compose
Open the compose.yaml file and set STAGE to production:
...
https-portal:
...
environment:
STAGE: 'production'
networks:
- frontend-network
...
Add custom certificates manually
Let's Encrypt can only provision a certificate if your Retool deployment has full internet access. If you deploy Retool on a VPC without complete access to the internet, you can manually add certificates instead.
If you are using Retool Mobile or hosting your deployment behind a firewall, concatenate your primary certificate file and intermediate certificate file. This ensures that the server presents the full chain of certificates and the root issuer is validated.
Modify HTTPS configuration
Update the https-portal service in the compose.yaml file to use an nginx image, and create two Docker volumes for your certificates. Rename the https-portal service to nginx.
nginx:
image: nginx:latest
ports:
- "80:80"
- "443:443"
command: [nginx-debug, "-g", "daemon off;"] # Improve error logging in the container
volumes:
- ./nginx:/etc/nginx/conf.d
- ./certs:/etc/nginx/certs
links:
- api
depends_on:
- api
networks:
- frontend-network