Skip to content

Open a database from your machine

A database you run on Flui is not on the internet. It has no public address, no port anyone can scan and nothing to point a client at. That is the safe default, since a database exposed to the world is an expensive mistake, but it means you need a way in the first time you want to look at a row.

There are two ways in:

  • A tunnel. flui db tunnel puts the database on your own machine, at 127.0.0.1, for as long as the command runs. Your usual tools connect to it: psql, DBeaver, mongosh, your application’s ORM.
  • The console in the browser. Nothing to install or run, and read-only by default. Good for a quick check.

Neither one opens the database to anybody else. The tunnel is bound to your loopback address and closes with the command. The console runs every request through Flui’s own API, so the browser never talks to the database.

The tunnel, and the console

The application’s name is the only argument:

Terminal window
flui db tunnel my-database

It stays in the foreground, so an open tunnel is always visible in a terminal. Press CTRL-C to close it.

While it is open, it prints everything a client needs:

✅ Tunnel up. Connect a client to:
Host: 127.0.0.1
Port: 55432
Database: appdb
User: appuser
Password: ...
📝 Connection string:
postgresql://appuser:...@127.0.0.1:55432/appdb
🧪 PostgreSQL client:
PGPASSWORD='...' psql -h 127.0.0.1 -p 55432 -U appuser -d appdb

Copy the connection string into your ORM, or paste the client line into a second terminal. Both match the engine you are running.

If the connection drops, the command reconnects on its own and prints the coordinates again. Pass --no-retry to turn that off when you would rather see the failure.

Which port it binds

The local port is chosen per engine and differs from the engine’s usual port: 55432 instead of 5432, so a tunnel does not clash with a Postgres already running on your machine. Tunnels to different kinds of database do not collide either, except Redis and Valkey, which share one port.

EngineLocal port
PostgreSQL55432
MariaDB53306
Redis / Valkey56379
FerretDB57017

Pass --local-port <n> to pick another port, for example to run tunnels to two Postgres databases at the same time.

The tunnel covers only these five engines. For anything else it answers that the database is not supported. For Kafka, an object store or a search engine, use the browser console.

The other flags, and the other commands

-c, --cluster <name|id> picks the cluster. You can leave it out when your profile has only one.

The rest of the db commands work on the same databases:

CommandWhat it does
flui db credentials <app>The in-cluster address and credentials, which another app running on Flui uses. The password is hidden unless you pass --show.
flui db dump <app-id>A logical SQL dump of a Postgres or MariaDB database, produced by the engine’s own tool. -o <file> to name it, or --s3-destination <id> to send it to a backup destination instead of downloading.
flui db restore <app-id> <file>Runs a dump back into the live database. It overwrites existing data and asks before it does; --yes skips the prompt.
flui db disk <app-id>How full the storage under the database is. When it is full, the database can no longer write.
flui db backup-status <app-id>For Postgres: whether continuous backup is on, how far back you can recover, and the last base backup. --json for machine-readable output.
flui db pitr-restore <app-id> --name <new>Rebuilds a Postgres database as of a point in time into a new install. The source is never touched. --at <ISO-8601> sets the moment; without it, the latest.

tunnel and credentials take a name, a slug or an id; the others take the application’s id, from flui app list.

What the tunnel needs from you

If you can run the CLI, you already have both things the tunnel needs.

The first is access to the application, the same access opening its console needs. See Who is allowed to open one below.

The second is a way onto the cluster. There is no key to set up: the CLI signs a short-lived certificate for you from the SSH authority your profile manages, uses it and discards it.

That connection is also why the tunnel can show the password. The API returns only the coordinates (engine, database, user), and the CLI reads the password from the cluster itself, over the connection it already opened. No password crosses the HTTP API on this path, which is the same rule the console follows.

Who is allowed to open one

Opening a database is decided by the same access engine as every other route in the product:

  • Owning the application is not enough by itself. You need a grant that reaches it (the same grant that lets you operate it anywhere else) and the right to reach an application’s data, which every role carries except Platform operator.
  • Revoked access applies here too. A grant revoked, or narrowed to a different set of applications, closes the console and the tunnel along with everything else.
  • An agent credential is checked first, before the application is even looked up. A key scoped to reading logs cannot reach an arbitrary query prompt, even when the person who created it owns the database.
  • Applications the platform installed for itself open only to someone with authority over the whole installation.
  • A refusal does not say “it belongs to somebody else”. It reads as an absence, with the same words every time. Trying ids until one answers differently tells you nothing.

The whole db family shares that gate: the tunnel, the credentials, the dumps, the disk report and the point-in-time restore all run the same check before they answer.

Every query the console runs is recorded on the server, whether it succeeded or not.

There is no agent tab on this page

No tool on the agent surface opens a console or a tunnel, by design. A tunnel is a live connection to your data and a console is an arbitrary query prompt; a person opens, watches and closes both. An agent that needs a fact about your data should be asked for a query you run yourself.

The platform’s own two databases

Two names do not belong to any application, and flui db tunnel handles them itself: platform-postgres and identity-provider. They are Flui’s own database and the identity provider’s. The browser console never opens them. The tunnel is the only way in, and it needs authority over the whole installation.

They have their own page: Reach the platform’s own database.

Where this goes next