Configure PostgreSQL
Use the bundled PostgreSQL service or connect Supermetry to a dedicated PostgreSQL 18 database.
Choose the bundled database for the simplest install, or create a dedicated database on an existing PostgreSQL server.
-
Use PostgreSQL 18, the supported baseline. The installer warns when it connects to an older server.
-
For a Docker install with the bundled database, keep the generated
POSTGRES_PASSWORDin.envand start the stack.Terminal window cd /opt/supermetrydocker compose up -d -
For your own PostgreSQL server, create a role and database. Replace
CHANGE_MEbefore running the command.Terminal window sudo -u postgres psql <<'SQL'CREATE ROLE supermetry LOGIN PASSWORD 'CHANGE_ME';CREATE DATABASE supermetry OWNER supermetry;SQL -
Set the connection URL in the Supermetry environment file.
Terminal window sudoedit /etc/supermetry/supermetry.envUse
sslmode=disableonly for a local connection that does not need TLS:SUPERMETRY_DATABASE_URL=postgres://supermetry:CHANGE_ME@127.0.0.1:5432/supermetry?sslmode=disableFor a remote database, use TLS:
SUPERMETRY_DATABASE_URL=postgres://supermetry:CHANGE_ME@db.example.com:5432/supermetry?sslmode=require -
Restart Supermetry. It runs database migrations during startup.
Terminal window sudo systemctl restart supermetrysudo systemctl status supermetry --no-pager
What you should see: the service is active and starts without a PostgreSQL connection or migration error.