Better-PaaS
Guides

Databases & Add-ons

Spin up managed Postgres, Redis, and MySQL and attach them to your apps in one click.

Most real apps need a database. Better-PaaS can run Postgres, Redis, and MySQL for you as managed containers — no manual setup, no separate hosting.

Creating an add-on

Go to the Add-ons screen in the dashboard.

Choose a type — Postgres, Redis, or MySQL — and give it a name.

Create it. Better-PaaS starts a container for it on a shared internal network.

Attaching an add-on to an app

Creating a database isn't enough — your app needs to know how to reach it. Attaching handles that automatically:

Open the add-on (or your app's config) and attach the add-on to an app.

Better-PaaS injects the connection details into the app as environment variables — host, port, username, password, database name, and/or a ready-to-use connection URL.

Redeploy the app. Your code reads the injected variables and connects.

Why a shared internal network?

Add-ons run on a private Docker network alongside your apps. That means your app talks to the database over the internal network — it isn't exposed to the public internet, which is exactly what you want for a database.

Reading the connection in your app

Because connection details arrive as environment variables, your code stays portable:

Node.js + Postgres
import { Pool } from 'pg';

// Better-PaaS injects DATABASE_URL when you attach a Postgres add-on.
const pool = new Pool({ connectionString: process.env.DATABASE_URL });

The exact variable names appear in the app's config after you attach, so you can match them precisely. As a reference, each type injects:

TypeVariables injected
PostgresDATABASE_URL, PGHOST, PGPORT, PGUSER, PGPASSWORD, PGDATABASE
MySQLDATABASE_URL, MYSQL_HOST, MYSQL_PORT, MYSQL_USER, MYSQL_PASSWORD, MYSQL_DATABASE
RedisREDIS_URL, REDIS_HOST, REDIS_PORT, REDIS_PASSWORD

Browsing and querying data

You don't need a separate database client to peek inside an add-on. From the Add-ons screen you can open a built-in explorer to browse tables, page through rows, and run queries (or redis-cli commands) against a running database. See Database Explorer.

Detaching and deleting

  • Detach removes the connection variables from an app but keeps the database and its data.
  • Delete removes the add-on container entirely.

Deleting is permanent

Deleting an add-on destroys its container. If it holds data you care about, back it up first.

Next step

On this page