Deploy Retool with Azure VM
Learn how to deploy Self-hosted Retool with Azure VMs.
Follow the instructions in this guide to deploy self-hosted Retool on an Azure VM.
Requirements
To deploy Retool on Azure VM, you need:
- A Retool license key, which you can obtain from my.retool.com or your Retool account manager.
- Some familiarity with Azure and Azure VMs.
- An Azure account.
1. Create an Azure VM instance
-
In the Azure Portal, click Create a Resource. Under Virtual Machines, click on Create. Select a subscription and resource group. Name your VM, and select your preferred region.
-
At a minimum, select the
Ubuntu 22.04
image usingStandard_D2s_v3 - 2 vcpus, 8 GiB memory.
. Refer to Retool's storage requirements to see supported operating systems and select an instance that fits your needs. -
Select SSH public key in Authentication type, and provide a username. Select Generate a new key pair in the SSH public key dropdown, and name your key. Azure generates this key and stores it in the Azure KeyVault. You can download this key later and use it to log in to your remote VM.
-
In Public inbound ports, select Allow selected ports. Click Select inbound ports and select SSH (22), HTTP (80), and HTTPS (443).
-
In the next Disk section, select Standard SSD. Enable the Delete with VM option. Select Create, and attach a new disk. Name the disk and select None in Source type. Set the Size to 64 GiB and select OK. Ensure Delete with VM is enabled for the newly added data disk.
-
In the next Networking section, use the provided defaults. Allow the HTTP (80), HTTPS (443), and SSH (22) ports for inbound traffic, and ensure a public IP is set.
-
Enable Delete public IP and NIC when VM is deleted. Select Review + create.
-
Wait for the validations to pass, then click Create. Click Download private key and create resource from the resulting modal. Your Azure VM is now running.
-
Run the following command to ensure your downloaded key pair has the appropriate permissions for your SSH client.
chmod 400 <path_to_pem_file>
-
Wait on the Create VM deployment screen until your VM deployment is complete. After a couple of minutes, your VM will be deployed and you can click Go to resource.
-
On the Virtual machine status page, copy the public IP address.
2. Install Retool
- Open a new terminal and SSH into your new VM using the username you set, the public IP address, and your downloaded
.pem
key pair:
ssh -i keypair.pem <username>@<public_ip>
- Once SSH’d in, clone the Retool on-premise repository and switch into the new directory:
git clone https://github.com/tryretool/retool-onpremise.git retool
cd retool
- Run the install script for Docker and Docker Compose:
./install.sh
3. Update environment variables
On Docker deployments, environment variables are set in docker.env
.
-
In
docker.env
, setLICENSE_KEY
to your license key. -
In
docker.env
, uncomment theCOOKIE_INSECURE=true
line. After you set up SSL, you should setCOOKIE_INSECURE
tofalse
.
4. Set the version and start Retool
-
In your
Dockerfile
, replaceX.Y.Z
with a Retool version tag, for example2.117.2
. Identify the appropriate release version by viewing the tags on Docker Hub. See Retool's self-hosted release notes to learn about version-specific features. -
Start Retool. It may take a few minutes to pull the images and start each service.
sudo docker-compose up -d
- Confirm the containers are running.
sudo docker-compose ps
Self-hosted Retool is now running on an Azure VM. Go to http://<your-azurevm-ip-address>/auth/signup
to create your Retool admin account.
Additional steps
On production instances, you should:
- Externalize your PostgreSQL database to a managed service.
- Set up SSL on your deployment.
- Keep up-to-date with the newer versions of Retool.
For ease of use and as a proof of concept, the default docker-compose
configuration includes a PostgreSQL container, and it does not set up SSL. This is not suitable for production use cases, and you should host the Retool storage database on an external, managed database. Managed databases are more maintainable, scalable, and reliable than containerized PostgreSQL instances. Follow the instructions in the external storage database guide to configure your database.
Setting environment variables is also often necessary to configure SSO, source control, and other self-hosted features. See the environment variable reference for additional configuration options.
Update Retool
- Create a backup. Azure provides a method to back up your instance. If you don't perform a full backup, you should at least:
- Create a snapshot of your PostgreSQL database.
- Copy the environment variables in
docker.env
to a secure location outside of Retool.
- SSH into your instance and update your
Dockerfile
with the newer version number.
FROM tryretool/backend:X.Y.Z
- Install the upgrade.
./update_retool.sh
Retool instances temporarily go down while they upgrade. You can check the status of your containers with sudo docker-compose ps
.
Update configuration files
Occasionally, new Retool products and features require updates to the configuration files in retool-onpremise
or other Retool repositories. To update these files when new features are available, SSH into your Azure VM and pull the changes.
cd retool
git pull
Refer to the product or feature-specific documentation for configuration instructions.
Updated 6 days ago