Recipes

YugabyteDB

Self-hosted single-node YSQL — YSQL_* env, port 5433, driver stays postgres.

YugabyteDB's YSQL API speaks Postgres wire. Pin yugabytedb/yugabyte as store.sql and oke docker derives a single-node yugabyted service — credentials, healthcheck, and DATABASE_URL. Driver id stays postgres.

The one rule

Use the YSQL API only — never treat YCQL as store.sql. Vendor choice lives in images["store.sql"]; host maps :5432 → container :5433.

Quick start

Pin the image

oke.config.ts
images: {
  "store.sql": "yugabytedb/yugabyte:2025.1.0.0-b100", // pin a real tag
},

Bring the stack up

oke dev

oke docker injects YSQL_USER / YSQL_PASSWORD / YSQL_DB from OKE_STORE_SQL_* (password presence turns authentication on), runs bin/yugabyted start --background=false, and publishes YSQL on host :5432.

Connect

echo "$DATABASE_URL"
# postgres://oke:…@127.0.0.1:5432/oke

First healthy state is slower than plain Postgres — the healthcheck allows a long start period.

Required env

VariableWho sets itMeaning
OKE_STORE_SQL_USERoke docker → composeYSQL_USER
OKE_STORE_SQL_PASSWORDoke docker → composeYSQL_PASSWORD (enables auth)
OKE_STORE_SQL_DBoke docker → composeYSQL_DB
DATABASE_URLstack env for the appHost :5432 → container :5433

Data and backup

PathWhat lives there
/home/yugabyte/yb_dataNamed volume store-sql-datayugabyted base dir

Backup means: volume backup of store-sql-data, or Yugabyte's backup tooling. Losing that volume loses the universe data.

Production note

Single-node yugabyted is for local and small self-hosted use. For managed Aeon clusters, use the YugabyteDB provider. Pin a concrete tag; the image is large and cold-start is slower than Postgres.

What the recipe configures

FieldValue
Container port5433 (host publishes 5432)
Commandbin/yugabyted start --base_dir=… --background=false
Healthcheckysqlsh … SELECT 1 (90s start_period)
Connection URLpostgres://user:pass@host:5432/db
PreloadVendor — recipe does not replace yugabyted

Query performance

YSQL already preloads pg_stat_statements. Create the extension, then open Store → Performance. Do not add a Postgres command overlay.

Troubleshooting

Learn more

Next

On this page