Access local database or API

By default, docker-hosted instances use a bridge network, which does not support access to services on the docker-host via 127.0.0.1 or localhost from inside of the docker.

Here we take PostgreSQL as an example and show you how to access local API or database in different operating systems (OS) for docker-hosted Lowcoder.

Preparation

Assume that a Postgres service is ready on your local host with port 5432.

On Linux, you can check if Postgres runs locally with the command pgrep -u postgres -fa -- -D

How to access a local database or API from Lowcoder which runs inside the Docker

  1. Enter ifconfig docker0 in the terminal, and verify the IP configuration of Docker's virtual bridge (VB).

    Having set up Docker, the OS would automatically create docker0 using the IP address 172.17.0.1 (by default), through which the Docker service communicates with the host.

  2. Enter the same IP address into Lowcoder to configure the Postgres data source (172.17.0.1 in this example, but use the actual IP address displayed on your terminal in the real case).

On Windows and Mac:

Access a Database on your local network from Lowcoder which runs in Docker
Access an API on your local network from Lowcoder which runs in Docker

Last updated

Was this helpful?