---
title: "How to provision PostgreSQL on Rock8Cloud"
description: "Provision a PostgreSQL inside your project and connect it to your app in one click - credentials generated, variables accessible, app redeployed."
tech: "PostgreSQL"
icon: postgresql
category: services
pubDate: 2026-06-04
image: /how-to/og/postgresql.png
imageAlt: "How to provision PostgreSQL on Rock8Cloud"
headerImage: true
ctaTitle: "Your database, one click away."
ctaTitleHighlight: "Ship today."
ctaSubtitle: "PostgreSQL provisioned and connected to your app in one click. No DevOps, no surprise bills."
ctaIcons: [postgresql]
order: 90
steps:
  - name: "Add a service"
    text: "In your project, click Add Service and pick Database, then PostgreSQL."
  - name: "Pick a version and size"
    text: "Choose PostgreSQL 14–17, 1–100 GB storage, and optionally a high-availability replica. Rock8Cloud provisions it with secure, auto-generated credentials."
  - name: "Link it to your app"
    text: "Open your app's Env vars tab and add the connection variables - most frameworks just need DATABASE_URL."
  - name: "Save"
    text: "Your app automatically redeploys with the connection wired in."
faq:
  - q: "Do I manage database credentials myself?"
    a: "No. Credentials are auto-generated at provisioning, encrypted at rest, and accessible to your app as environment variables when you link the service."
  - q: "Which PostgreSQL versions are available?"
    a: "Versions 14 through 17, with 1–100 GB storage and an optional high-availability replica."
  - q: "How does my app connect?"
    a: "Link the ready-made URL variable as DATABASE_URL (or map HOST, PORT, NAME, USER, PASSWORD individually). Your app redeploys and the values become accessible."
---

Provision a PostgreSQL inside your Rock8Cloud project and connect it to your app **in one click** - credentials are generated for you, accessible as environment variables, and your app redeploys connected. No external vendor, no separate bill.

## Provision and connect in one click



[Pick the engine and provision it in one click](https://minio.11333311.xyz/vibeham-docs/db_selection.mp4)



1. **Add a service.** In your project, click **Add Service → Database → PostgreSQL**, pick a version (14–17), storage (1–100 GB), and optionally a high-availability replica.
2. **Link it.** Open your app's **Env vars** tab and add the connection variables under the names your framework expects.
3. **Save.** Your app automatically redeploys - connected. Secrets never touch your repo.



[Link environment variables in one click](https://minio.11333311.xyz/vibeham-docs/env_configuration.mp4)




## Connect from your app

When you link the database, you name the variable yourself. Most frameworks expect `DATABASE_URL`, so link the **Connection URL** under that name:

```bash
# You choose the name when linking - e.g.
DATABASE_URL   # → postgres://USER:PASSWORD@HOST:PORT/NAME?sslmode=require
```

Linking a connection URL also adds its building blocks automatically - `DB_HOST`, `DB_PORT`, `DB_NAME`, `DB_USER`, and `DB_PASSWORD` appear alongside it, ready to use individually.

When you link, you pick what the variable maps to - PostgreSQL offers:

| Link option | Maps to |
|---|---|
| Host | auto-generated hostname |
| Port | `5432` |
| Database name | your database name |
| Username | auto-generated, kept secret |
| Password | auto-generated, kept secret |
| Connection URL | `postgres://USER:PASSWORD@HOST:PORT/NAME?sslmode=require` |
| Connection URL (libpq-compatible) | the same URL with `&uselibpqcompat=true` appended |

**Connection URL** is the safe default and works with Prisma, Spring, Rails, sqlx, postgres.js and the rest. Pick the libpq-compatible variant only when your client reads `uselibpqcompat`, which Node's `pg` does.

The database is network-isolated to your project: reachable by your services, never exposed publicly. To look at the data yourself, deploy a client inside the project - see [browse your database with pgweb](/how-to/browse-postgres-pgweb).

Full reference and troubleshooting in the [PostgreSQL docs](https://docs.rock8.cloud/docs/databases-and-storage/postgresql).

Also provision: [Dragonfly (Redis)](/how-to/provision-dragonfly) · [S3 object storage](/how-to/provision-s3).
