Skip to content
ErawanACADEMYไทย

Make it real

A database — wired in for you

One command, and your app has Postgres with its connection string already in the environment. Here is what each plan gets, how to bring the data you already have, and what to watch for when you remove it.

Rather not set it up yourself? Erawan does it for free on Hobby and above.

1. Ask your AI for one

Attach an Erawan Postgres database to this app and have the app read DATABASE_URL.

From a terminal, run this.

erawan addon add my-app postgres

The app restarts with DATABASE_URL in its environment. Any library that speaks Postgres reads it and connects. There is no Erawan-specific client to learn, and you never copy a password anywhere yourself.

If the app's first start fails because there is no DATABASE_URL yet, that is expected: the app has to exist before a database can be attached to it. Once it is attached, the app restarts on its own and runs normally.

An app that uses AI to search by vector can use pgvector straight away. It comes with the database on every plan, so your app's migrations can run CREATE EXTENSION IF NOT EXISTS vector as written, with nothing to install and no separate vector service to rent.

2. How big it is

On Hobby the database lives on a Postgres instance shared with other accounts and can grow to 500MB, but it is yours alone and no other account can open it. The 30-day free trial gets the same as Hobby. From Pro up, the whole Postgres instance is yours: 1GB on Pro and 2GB on Max. See every plan

When you upgrade from Hobby to Pro, the data is moved for you: copied and checked before the old one is removed, so if any step fails the app stays on the database it had. On Pro and Max the database's disk size is set once, when it is created. If you do not name one, you get the plan's full size.

From Hobby up, the database can be rewound to an earlier point. The steps are in Rewind your database to an earlier point. Encryption and how apps are kept apart are covered on the security page.

3. Bring your existing data

If you already have data, on your laptop or at another host, take a pg_dump, compress it with gzip -c dump.sql > dump.sql.gz, and send it into the app's database with this.

erawan db import my-app dump.sql.gz

The file goes straight into the database through your account, never parked at a link first. If the database already has tables, the import refuses to overwrite them unless you add --force. Order matters too: import before the app runs its own migrations, or migrations written for your old schema will fail.

4. Removing it

erawan addon rm my-app postgres

This deletes the database and everything in it. If you still need the data, back it up before you remove it.

If your project has an erawan.yaml with addons: [postgres] in it, take that line out too. It tells Erawan the app needs a database before it starts, so if you keep it, the next deploy creates a new, empty one, and no message tells you the removal did not stick.

All Erawan Cloud lessons