Skip to content

Databases

The db topic is the path for connecting to a Flui database building block with a native clientpsql or pgAdmin for Postgres, mariadb or DBeaver for MariaDB, redis-cli for Valkey/Redis, or your application’s ORM. A Flui database is just an application running in the cluster, so it is identified the same way as any other: by its name, slug, or id.

Flui databases are not exposed outside the cluster network — there is no public endpoint to point a client at. The two commands here bridge that gap from your workstation:

  • flui db credentials prints the in-cluster address and credentials — what another app running on Flui uses to reach the database.
  • flui db tunnel opens a temporary local tunnel so a client on your machine can connect.

Both take a database application as their first positional argument and accept -c, --cluster <name|id> to pick the cluster (auto-detected when the active profile has only one). Both read the password straight from the in-cluster Secret over SSH — never from the API.

If you would rather not install a local client, the dashboard ships an in-browser SQL/KV console for the same databases — see The database console. These CLI commands are the native-client path; the console is the in-browser one.

flui db credentials <app>

Shows how to connect to a Flui database: the in-cluster service address and its credentials, plus a ready-to-copy DATABASE_URL. This is the connection information for another app running on Flui in the same cluster — the host is the in-cluster service DNS name, not a public address.

The password is read from the in-cluster Secret over SSH and is hidden by default. Pass --show to print it in plaintext.

Terminal window
flui db credentials postgresql-051f58
flui db credentials postgresql-051f58 --show
flui db credentials postgresql-051f58 --show --hide-after 30
FlagDefaultEffect
-c, --cluster <name|id>auto-detectCluster to resolve the database in.
--showoffPrint the password in plaintext (hidden otherwise).
--hide-after <seconds>0Opt-in optical wipe: hold the terminal for N seconds with a countdown, then erase the password from the screen. Only takes effect together with --show on a TTY; 0 returns immediately.

To connect a native client from your own machine, use flui db tunnel instead — the in-cluster host shown here is not reachable from outside the cluster.

flui db tunnel <app>

Opens a local tunnel to a Flui database so you can connect a native client. Because Flui databases are not exposed outside the cluster, the command forwards the connection through the control plane over SSH plus an in-cluster port-forward — no public endpoint is opened. It stays in the foreground; press CTRL-C to close the tunnel.

Once the tunnel is up, the command prints the loopback host/port, the credentials, a connection string, and a one-line client invocation for the engine (for example a psql or mariadb command).

Terminal window
flui db tunnel postgresql-051f58
flui db tunnel postgresql-051f58 --local-port 5544
flui db tunnel postgresql-051f58 --no-retry
FlagDefaultEffect
-c, --cluster <name|id>auto-detectCluster to resolve the database in.
--local-port <n>engine defaultLocal port to bind on 127.0.0.1. Defaults are engine-specific: 55432 for Postgres, 53306 for MariaDB, 56379 for Valkey/Redis.
--[no-]retryonReconnect automatically if the SSH session drops. Disable with --no-retry.

With the tunnel running, point any client at 127.0.0.1 on the local port — for example:

Terminal window
flui db tunnel postgresql-051f58 # leaves the tunnel open in this terminal
# in another terminal
psql -h 127.0.0.1 -p 55432 -U <user> -d <database>

How it relates to the dashboard console

These commands are the native-client path: they put a real Postgres/MariaDB endpoint on your loopback interface so any local tool or ORM can talk to it. The dashboard’s database console is the in-browser path — run SQL or browse keys without installing anything, with data-blind AI assist. Both operate on the same Flui database building blocks; pick whichever fits the task.