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
Open Applications โ your application โ Environment.
Click Add New โ Add service โ Database โ Postgres.
Enter a service name you will use in reference variables (no need to match the Postgres database name inside the engine).
Click Create Service, open the service, then click Deploy on Overview.
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://orpostgresql://, 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:
Open the Variables tab.
Click the
{ }(braces) control beside the value field.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 }} 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.