How to create a Free-tier Aiven PostgreSQL 18 service using the avn CLI (when it's missing from the web UI)
Last verified: 2026-07-25 Tags: Aiven, PostgreSQL 18, Aiven CLI,
avn, free tier, free-1-1gb, preview version, managed Postgres, database provisioning TL;DR: As of this writing, Aiven's web console only lets you pick PostgreSQL up to version 17 on the Free plan, because PG 18 is still taggedpreview. The Aiven CLI has no such restriction — you can create a Free PostgreSQL 18 service directly withavn service create.
Aiven's Free plan (free-1-1gb) is normally created through the web console, but the console's version picker only offers PostgreSQL versions that Aiven has promoted out of preview status. At the time of writing, PostgreSQL 18 is available but still marked preview, so it does not show up as a selectable option in the UI — even though the underlying platform fully supports provisioning it.
The Aiven CLI (avn) talks directly to the Aiven API and is not limited by what the console exposes, so it can provision a preview version like PostgreSQL 18 on the Free plan without any workaround or support ticket.
- Aiven CLI installed (
pip install aiven-client) - Logged in:
avn user login <your-email>(oravn user login --token) - An existing Aiven project (referred to below as
lysak— replace with your own project name)
avn service versions | grep -E '^pg[[:space:]]+18'Expected output:
pg 18 preview
The preview state is exactly why PostgreSQL 18 is hidden from the Free plan dropdown in the web console, but it is still fully creatable via the API/CLI.
avn service create my-postgres-18 \
--project lysak \
--service-type pg \
--plan free-1-1gb \
-c pg_version=18Important — plan naming gotcha:
Use exactly:
free-1-1gb
Do not prefix it with the service type, e.g. pg:free-1-1gb — a colon is not allowed in a plan name and Aiven will reject the request with a validation error.
avn service wait my-postgres-18 \
--project lysakWhile provisioning, the service commonly reports a REBUILDING state for a while — this is normal and does not indicate a plan change. avn service wait blocks until PostgreSQL is actually RUNNING and ready to accept connections.
# 1. Check PG18 availability/status
avn service versions | grep -E '^pg[[:space:]]+18'
# 2. Create the Free-tier PG18 service
avn service create my-postgres-18 \
--project lysak \
--service-type pg \
--plan free-1-1gb \
-c pg_version=18
# 3. Wait until it's up and running
avn service wait my-postgres-18 \
--project lysakREBUILDING only describes provisioning state — it says nothing about billing. To confirm you're really on the Free tier (and not Developer/Startup/Business), check the plan field explicitly:
avn service get my-postgres-18 \
--project lysak \
--json |
jq '{
service_name,
service_type,
state,
plan,
cloud_name,
pg_version: .user_config.pg_version
}'Expected value:
"plan": "free-1-1gb"That confirms PostgreSQL 18 is running on the free free-1-1gb plan, not a paid tier.
PLAN=$(avn service get my-postgres-18 \
--project lysak \
--json |
jq -r '.plan')
if [ "$PLAN" = "free-1-1gb" ]; then
echo "✅ FREE: this PostgreSQL service is running on the free plan"
else
echo "❌ NOT FREE: active plan is — $PLAN"
exit 1
fi- The web console version picker is limited to non-
previewversions on Free plans; the CLI is not. - Plan name is
free-1-1gb, without apg:prefix. REBUILDING= still provisioning, not a plan/billing signal. Always check theplanfield viaavn service getto confirm you're on Free tier.- Full lifecycle:
avn service versions→avn service create→avn service wait→avn service get(verify plan).
Written for both humans and AI coding agents troubleshooting "PostgreSQL 18 not available on Aiven Free plan" or "Aiven preview version not selectable in console".