SSH Tunneling
You can connect Postgres, MySQL, MSSQL, MongoDB, and other databases that are hosted under a private network via SSH tunnels.
Follow the instruction below to configure SSH tunneling in UI Bakery:
Start by navigating to the data source connection window - choose your data source and select the Enable SSH tunnel checkbox.
For already connected data sources, you just need to open their settings.

Now, you need to configure your bastion host to allow UI Bakery to establish an SSH tunnel:
Create a UI Bakery user (UI Bakery will connect to your bastion as this user):
# Use this command if you use Amazon Linux sudo adduser uibakery --password NP # Use this command if you use any other Linux/Mac sudo adduser uibakery --disabled-password
Next, create the required
authorized_keys
file and configure its permissions:# Login as root user sudo su # Create the authorized_keys file if it does not exist mkdir -p /home/uibakery/.ssh touch /home/uibakery/.ssh/authorized_keys # Set required permissions and make uibakery user an owner of this file chmod 644 /home/uibakery/.ssh/authorized_keys chown uibakery:uibakery /home/uibakery/.ssh/authorized_keys
Now, go back to the data source connection window, copy the SSH public key, and paste it to the
authorized_keys
file:# Use any text editor and insert previously copied ssh public key in authorized_keys file vim /home/uibakery/.ssh/authorized_keys

Once connected, return to UI Bakery and specify your bastion host and port number under the Enable SSH tunnel checkbox.
Next, specify the Bastion user you created in Step 2 (a).

Finally, scroll up to the Connection settings section and specify all the required fields.

ℹ️ Please note that in the Host field you either need to specify:
localhost (if the bastion and database are on the same virtual machine) or
your private network IP address (if bastion and database are on different virtual machines with mutual access and the 3306 port is open)
Click Test connection to check whether the data source can be connected, and then click Connect Datasource.
Last updated
Was this helpful?