May 15, 2021

Redash on Docker Connect to Database Over SSH Tunnel

Activities, Android Developer, Ansible, Apache2, Atlassian, Ayo Belajar Linux, Bestpath Network, BLC Telkom Klaten, BSD, Caddy Server, Case Study, Cisco, Cisco Indonesia, Cloud Computing, Cockpit, Custom Weapons, Docker, E-Learning, Engenius, Error, FreeBSD, FreeBSD Indonesia, Komunitas Pengguna Linux Indonesia, KPLI Bulukumba, KPLI Klaten, Lets Encrypt, Linux, MacOS, Microsoft Azure, Microsoft SQL Server, MikroTik, MikroTik Indonesia, MySQL, Nginx, Open edX, OpenSID, Others, PHP, phpMyAdmin, PostgreSQL, Proxmox, Python, Redash, Sendy, SSH, Stories, Subnetting, TP-Link, Ubiquiti, Unix, Virtualization, Windows, X-Mosque, Faizar Septiawan, Icar, siBunglonGanteng, Orang Ganteng, siBunglonLabs, Programmer, SysAdmin, Site Reliability Engineer, Developer, Palugada, Makassar, Ganteng, Gila, Cyclist, Panglima, Setan, Panglima Setan, sibunglon, Ganteng

Redash is an application for data visualization from a database and is Open Source.

Currently Redash can be run directly on several cloud providers using the Redash image provided, including Docker. Please visit the official website for more information

You can install Redash in a local environment (laptop or personal pc) and you can also connect it to a database in the local environment as well a database on a public server. However, usually databases that are on public servers are not open to the public, therefore to connect to the database it is necessary to create a tunnel to the database via SSH.

To create a tunnel directly from the terminal or use bash, use the following syntax:

$ ssh -L 3389: [email protected]

Or if you want to use SSH Config, you can use the following configuration:

Host devx-sibunglon
    User user

-) devx-sibunglon : the hostname used when connecting to the server. To connect to the server, just use the command ssh devx-sibunglon.

-) 3389 : port database running in local environment after successfully connecting to server using SSH

-) 3306 : database port running on the server

-) user : the username used goes to the server via SSH

-) : hostname server

After successfully connecting to the server via SSH, based on the previously created SSH tunnel, the database connection in Redash can be configured as follows:

-) host : host.docker.internal

-) Port : 3389

-) And several configurations can be adjusted to the database configuration on the server, such as database name, database user and password.