PostgreSQL

Run PostgreSQL (Postgres) on dFlow: deploy, read internal credentials, wire apps with POSTGRES reference variables, and use Expose when needed.

Written By Charan

Last updated 3 days ago

PostgreSQL (labeled Postgres in the dFlow database picker) is a full-featured relational database: ACID transactions, SQL, indexes, extensions, and strong consistency for most application workloads.

Start with Databases overview if you have not added a database on dFlow before.


When to choose Postgres

Choose Postgres when you want a general-purpose SQL database for structured data, reporting, and typical web-app models. If you specifically need MySQL wire compatibility, compare MariaDB or MySQL instead.


Create and deploy

  1. Open Applications โ†’ your application โ†’ Environment.

  2. Click Add New โ†’ Add service โ†’ Database โ†’ Postgres.

  3. Enter a service name you will use in reference variables (no need to match the Postgres database name inside the engine).

  4. Click Create Service, open the service, then click Deploy on Overview.

  5. Wait until the deployment succeeds. dFlow provisions the instance on your environmentโ€™s compute; you do not install Postgres manually.


Connection details on Overview

After a successful deploy, Internal credentials include:

  • A connection URL (typically postgres:// or postgresql://, depending on how the platform formats it).

  • Username, password, host, port, and database name as separate fields for drivers that need them.

Use these values only for services in the same environment unless you know what you are doing.

Public URL, host, and port appear under Public credentials only after you click Expose. If you exposed the database, run Unexpose before Stop.


Link your app: reference variables

On an app or Docker service:

  1. Open the Variables tab.

  2. Click the { } (braces) control beside the value field.

  3. Select your Postgres database and the field (for example internal URI).

Inserted tokens use your service name and the prefix POSTGRES (from the database type). Example for a service named orders-db:

{{ orders-db.POSTGRES_URI }} 

Suffix

Resolves to

_URI

Full internal connection URL

_NAME

Database name

_USERNAME

User name

_PASSWORD

Password

_HOST

Internal host

_PORT

Internal port

_PUBLIC_HOST

Public host (after Expose)

_PUBLIC_PORT

Public port (after Expose)

_PUBLIC_URI

Public URL (after Expose)

Public suffixes stay disabled in the picker until the database is deployed and exposed.

More context: Database credentials and connections.


Internet access (Expose)

Expose opens one public port for typical Postgres clients. Use it when something outside dFlow must connect (CI, local GUI tools, partner systems).

Prefer internal URLs for application traffic that stays inside your dFlow environment.


Day-to-day actions

From Overview, Logs, Deployments, or Settings you can Restart, Stop, and Expose / Unexpose. Stop is blocked while the database is exposed.

After one successful Deploy, the Deploy button is hidden for this database service (no in-app redeploy wizard like some app services). Tab reference: Databases overview.


Troubleshooting

See Database troubleshooting for deploy failures, connection errors, and reference variable issues.


Useful links