# CloudNativePG / PostgreSQL

Postgres you run. CloudNativePG is Apache-2.0 on Kubernetes; PostgreSQL is the engine — Neon without the serverless meter.

**Replaces:** Neon

**Tier:** Medium

## Problem

Neon is hosted serverless Postgres with scale-to-zero and branching. You wanted the database on hardware you control. PostgreSQL is the engine (PostgreSQL License; github.com/postgres/postgres is a mirror). CloudNativePG is Apache-2.0 (cloudnative-pg/cloudnative-pg) if the job is a HA cluster on Kubernetes. This is not Neon's branching UX, scale-to-zero CU-hours, or every region SKU. Hosted Neon prices stay on /compare/managed-postgres. A Firebase-shaped BaaS stays on /replace/supabase.

## Stack

- [PostgreSQL](https://www.postgresql.org/) — PostgreSQL License database engine (official GitHub mirror: postgres/postgres)
- [CloudNativePG](https://cloudnative-pg.io) — Apache-2.0 Kubernetes operator for HA PostgreSQL

## Estimated SaaS cost saved

| You stop paying | Typical / year | Self-host instead |
|---|---:|---|
| Neon (small team) | $1,200 | PostgreSQL or CloudNativePG |

**About $1,200 / year** on a small team, before you count lock-in.

## Deploy on Railway

Placeholder: PostgreSQL as a Railway database, or CloudNativePG on a cluster you already run. Bind the app to the private Postgres URL. No one-click CloudNativePG template in this repo yet — Start on Railway. Hosted SKUs stay on /compare/managed-postgres.

[Start on Railway](https://c17.io/go/railway/cloudnativepg-postgres?from=%2Fstacks%2Fcloudnativepg-postgres.md)

[PocketBase if this is an app database in one binary, not Postgres](https://c17.io/stacks/go-pocketbase-htmx)

## AGENT_PROMPT

```
Replace Neon with PostgreSQL (preferred for a single instance) or CloudNativePG (HA on Kubernetes).

- Postgres: official image, persist the data directory, take backups. CloudNativePG: follow the operator docs on a cluster you already run.
- Restore one dump. Do not claim Neon branching or scale-to-zero. Write AGENT_PROMPT.md.
- Hosted comparison stays on /compare/managed-postgres.
```

## FAQ

### PostgreSQL or CloudNativePG?

PostgreSQL if you want one instance (Railway, a VPS, a volume). CloudNativePG if you already run Kubernetes and want HA. Pick one operator on day one.

### Is this Neon branching?

No. Neon branches are a hosted product. This page is Postgres you run. Copy is honest about that.

### Why not Supabase?

Supabase is a BaaS around Postgres (/replace/supabase, /compare/supabase-vs-pocketbase). This page is the database, not auth and storage APIs.

Source: https://c17.io/stacks/cloudnativepg-postgres
