Skip to main content

SQLite or PostgreSQL

SQLite or PostgreSQL

The controller keeps its state in one database. Both backends come from one source tree and are chosen when the controller is built.

SQLite (default)PostgreSQL
SetupNone; one file, created and migrated on first startmachinactl db setup pod|package|external
Fits1 or 2 hosts, labs, evaluationsHundreds of machines
ControllersOneSeveral on different hosts; one leader, hand-over inside the lease
BackupsOnline copypg_dump, daily dumps from the managed pod
Way backn/amachinactl db setup sqlite (the SQLite file is never touched)

Move to PostgreSQL​

sudo machinactl db setup pod --migrate # managed PostgreSQL 16 in Podman, copies your SQLite data
sudo machinactl db status # backend, login, size, migrations
sudo machinactl db backup

package installs PostgreSQL from apt or dnf; external --url postgres://user:pw@host/db uses your own server. At install time the same choice is scripts/install-platform.sh --database pod|package|external|sqlite. machina-dbtool copies a snapshot by hand.

What has been run​

The PostgreSQL build passes the controller's whole test suite on PostgreSQL 16. An isolated PostgreSQL-backed controller was run live: two controllers on one database elect one leader and hand over within the lease, and 500 machines list in under a second. A copy of the lab host's real database loaded with identical row counts. Not done yet: a PostgreSQL controller managing real hosts. Until a site has run on it, SQLite remains the safe default. Full guide · Claims ledger (C24).