Deploy Retool Database on Self-hosted

Learn how to configure Retool Database on Self-hosted Retool deployments.

🎉

beta

Retool Database is currently in beta on Self-hosted Retool 2.113 or later. Reach out to your account manager or Retool Support to enable Retool Database for your organization.

Retool Database for Self-hosted Retool enables you to use your own PostgreSQL database to store data instead of hosting it with Retool. Your database automatically connects to the main Retool backend service for your deployment. Using Retool Database, you can easily create tables, visually interact with your data, and connect your data to Retool apps.

Retool Database is included in all pricing plans. Because you control your own PostgreSQL database on self-hosted deployments, there are no data limits or overages for Retool Database on self-hosted deployments.

Use Docker Compose PostgreSQL container

🚧

Using Docker to host Retool Database is not recommended for storing production data, and Retool recommends externalizing the database

Retool Database runs as a separate PostgreSQL service in your Docker deployment, using PostgreSQL version 14.3 by default. Retool Database is automatically created and provisioned on new deployments which use Docker Compose.

Existing Docker Compose deployments

🚧

When upgrading from an existing deployment on versions 2.112 or earlier, you must run a one-time script to generate credentials for Retool Database before you upgrade.

To generate credentials for Retool Database, follow these steps.

  1. Check out the latest version of the retool-onpremise repository.
  2. Run retooldb_upgrade.sh.

After running retooldb_upgrade.sh, follow the usual process to update your Retool instance. Retool Database will then be configured as a resource and ready to use. You do not need to run retooldb_upgrade.sh on any future version updates.

Specify an external PostgreSQL database

Organizations with managed deployments using Kubernetes, Helm, ECS, or Google Cloud Platform must specify a PostgreSQL database to use for the backend. Organizations using Docker Compose can use the built-in PostgreSQL container, or specify an external database.

Requirements

To use Retool Database on managed deployments, you need:

  • A PostgreSQL database running version 14.3 or later.
  • Credentials for a database user with permissions to create databases and roles.

Import existing data

Your supplied PostgreSQL database can be empty or populated with data, but Retool always creates a new database for each of your environments. To import existing data to Retool Database, use pg_dump and psql commands. You can use the connection strings dropdown to find the database host, name, user, password, and port for the current environment.

Your pg_dump and psql commands might use the following structure.

pg_dump EXISTING_DATABASE_CONNECTION_STRING > pg_dump.sql
psql RETOOL_CONNECTION_STRING < pgdump.sql

1. Add database configuration

Navigate to {your-domain}/resources?setupRetoolDB=1 on Retool and fill out the form with the following fields.

SettingDescription
Database hostThe URL or IP address.
Database nameThe name of the database.
Database usernameThe username.
Database passwordThe password.
Database portThe port number.
Use SSL/TLSConnect with SSL/TLS.

Select Test your connection to confirm you can connect to Retool Database.
Deployment configuration settings for Retool Database

2. Save your resource

Click Save and initialize to save your Retool Database settings. You can now use with the Database editor UI to configure and interact with your Retool Database tables.