Skip to main content
Which database a bot uses isn’t a choice you make — it’s built into that bot. Check its .env.example (a DATABASE_URL starting with postgres:// means Postgres; a DB_PATH or similar pointing at a .db file means SQLite) if you’re not sure which you have.

SQLite bots

Nothing to set up. The bot creates its database file on first run, at the path set in .env (or a sensible default if unset). Back it up by copying that one file — stop the bot first so you’re not copying mid-write.

PostgreSQL bots

You need a running Postgres server (13+) before the bot will start.
1

Start Postgres

Easiest via the docker-compose.yml most of these bots ship with:
Or point DATABASE_URL at any Postgres server you already run.
2

Set DATABASE_URL

In .env: DATABASE_URL=postgresql://user:password@host:5432/dbname
3

Run migrations

The Python bots that use Postgres manage schema with Alembic:
Do this once before the first start, and again after every update that changes the schema — check that update’s release notes.
Never run migrations against a production database without a recent backup. alembic upgrade head applies every pending migration in order — if one has a bug, you want a way back.

Next: hosting

Keep it running past your terminal session.