DATABASE_URL and the other DATABASE_* variables. There is no password to copy.
The app connects over Raff’s private network, always with TLS. You can add the database when you create the app, or link one you already have.
Before you start
- To link an existing database: a running Postgres database in the same account. See Create a database.
- To create one with the app: your account’s free database still unused, or the $7.99 a month plan.
Add a database when you create the app
1
Find the Database section
On the Deploy an app page, after you pick the code, find Database. For a template it shows only when the template keeps data in Postgres.
2
Pick an option
A template that needs Postgres starts with it picked.

3
Deploy
Click Deploy.
- Pay-as-you-go account: Raff creates the database and the app at once.
- Monthly account: the app and its database are one order at checkout, with the database as a line under the app. A free database is created when you pay.
4
Wait for the first deploy
The app page shows Starting the database. Once the database runs, Raff links it and starts the first deploy, so
DATABASE_URL is set from the start.n8n-db, and creates it with public access on, like any new database. The app does not need public access: it uses the private network. To turn it off, see Turn on public access.
Link a database you already have
From the database’s page:- Open the database and go to the Apps tab.
- Under Linked apps and functions, pick the app in Choose an app… and click Link an app.
- Raff creates a database user for that app, adds the variables and redeploys the app.
- Open the app and go to the Bindings tab.
- Click Attach, choose Database, and pick the database.
- Keep Env var prefix as
DATABASE_and click Attach. The app redeploys with the connection.
The variables your app gets
For a template, the link also fills in the app’s own database settings, so the app uses the database without extra setup.
The variables show on the app’s Environment tab with the database as their source. Change them through the link, not there.
DATABASE_URL and DATABASE_PASSWORD are masked.
A second database: attach it from the Bindings tab with another prefix, for example ANALYTICS_. It gets ANALYTICS_URL, ANALYTICS_HOST and the rest; DATABASE_URL stays with the first database.
Connect with TLS
New databases refuse connections without TLS.DATABASE_HOST is a name on the database’s certificate, so your app can check the server with DATABASE_CA_CERT.
Node.js (pg):
ssl option, pg connects without TLS and the database refuses it with pg_hba.conf rejects connection ... no encryption.
psql and other libpq clients: write the CA to a file and use sslmode=verify-full with sslrootcert:
DATABASE_HOST is on Raff’s private network, so run this inside the app, for example from the Shell tab.
Change or remove the link
On the app’s Bindings tab:- Rotate credentials issues a new password and redeploys the app with it. The old password stops working at once.
- Delete binding removes the app’s database user and its
DATABASE_*variables, and redeploys the app without them. The database itself stays.
What happens on delete
When you delete the app, the dialog lists its databases with Keep (the default) or Delete:- Keep: the database keeps running and billing, for example “Keeps running and billing $7.99/mo”. Only the app’s login to it is removed.
- Delete: the database is deleted with the app. Its backups are kept for 14 days, and on monthly billing the unused part of the month goes back to your balance.
- A database another app also uses is always kept.
DATABASE_* variables, so their next deploy starts without them. Delete removes those apps too.
Use the API
Create the app withlink_database_id, the database’s id (a UUID) from List databases or Create database:
Next steps
Connect to a database
Connect from your laptop or other tools.
Set environment variables
Add the rest of the app’s settings.