Koo Docs
View as Markdown

Postgres

Koo runs Postgres for you as a managed service inside your app. You add it like any other service, pick a size, and Koo handles provisioning, storage, and the connection wiring — there is nothing to install or operate.

Your free Postgres

Every account includes one Postgres at 0.5 vCPU / 1 GiB, free forever, no card required.

The free Postgres is part of your account's permanent free allowance, alongside one free web service and one free Redis. See Free tier & pricing for how the allowance works.

The allowance applies to your primary account — the first account you create. Secondary accounts pay from $0.

Add Postgres to an app

Postgres is a service of type postgres inside an app:

  1. Open the app you want to add a database to.
  2. Add a new service and choose Postgres as the type.
  3. Pick its CPU and memory — the free unit (0.5 vCPU / 1 GiB) is covered by your free allowance.
  4. Choose the environment variable name the connection string will be injected under (for example DATABASE_URL).

Koo provisions the database and attaches a dedicated disk. Once the service reports Ready, your database is live.

A Postgres service is always private to its app. It has no public URL and is never exposed to the internet — only the other services in the same app can reach it.

Connect from your app

You don't copy connection strings around. When you attach Postgres to a web service, Koo injects the full connection string into that service as an environment variable, under the name you picked when you attached it.

Read it from your app's environment like any other variable:

bash
psql "$DATABASE_URL"

The connection string points at a private hostname that only resolves inside your app, and it stays current if the database is re-provisioned. See Environment & secrets for how injected variables work alongside your own.

Resources & storage

You give Postgres explicit CPU and memory, like any service; disk is a separate volume provisioned with the service. Some example combinations:

Pick any CPU + memory (memory up to 8 GiB per vCPU). Disk is provisioned separately as a volume.
vCPUMemoryPrice
0.25 vCPU512 MiB$5/mo
0.5 vCPU1 GiB$10/mo
1 vCPU2 GiB$20/mo
2 vCPU4 GiB$40/mo
4 vCPU8 GiB$80/mo

Your data lives on the service's dedicated disk and persists across deployments and restarts of your other services.

Upsizing

Resizing keeps your free share: give your free Postgres more CPU or memory and you pay the difference — its new price minus the free unit's — while the first 0.5 vCPU / 1 GiB stays free. Downsize back to the free unit and you're back to $0.

Until self-service checkout ships, the Free plan caps Postgres at the free unit (0.5 vCPU / 1 GiB), so upsizing beyond the free allowance requires a paid plan. See Billing.

Coming soon

Coming soon SQL console — you will be able to open a SQL console for your managed Postgres directly in Koo and run queries without leaving the dashboard.

Coming soon Snapshots & backups — Koo will snapshot your Postgres on a per-tier cadence, and you will be able to restore a snapshot into a brand-new Postgres service while the original stays untouched.