Skip to content

CLI commands

Find every Supermetry command, subcommand and command-line flag.

Use the supermetry binary to serve the app and run installation or maintenance tasks.

  1. Confirm the installed version and list the top-level commands.

    Terminal window
    supermetry version
    supermetry --help
  2. Choose the command you need. Commands without listed flags accept none.

    Command Purpose and flags
    supermetry Start the server. supermetry serve is the explicit equivalent.
    supermetry install Configure an install. Flags: --mode, --base-url, --database-url, --db-host, --db-port, --db-user, --db-password, --db-name, --db-sslmode, --listen, --proxy, --image, --dir, --yes, --dry-run, --version, --apply.
    supermetry backup Create a database archive. Flag: --out FILE; default is a timestamped .tar.gz name.
    supermetry restore FILE --yes Replace the configured database from an archive. --yes is required.
    supermetry migrate Apply pending database migrations.
    supermetry user create Create a user and organization. Required flags: --email, --org.
    supermetry user reset-password Start a password reset. Required flag: --email.
    supermetry user make-admin Grant instance-admin access. Required flag: --email.
    supermetry user remove-admin Remove instance-admin access. Required flag: --email; the last instance admin cannot be removed.
    supermetry geoip update Download the configured MaxMind editions. No flags.
    supermetry recompute-rollups Rebuild all closed-day rollups. No flags.
    supermetry migrate-labels Re-encrypt pre-rename stored secrets and rewrite path-policy IDs. No flags.
    supermetry close-days Close an inclusive range of site-local days. Required flags: --site, --from, --to; dates use YYYY-MM-DD.
    supermetry load Read ordered NDJSON events from standard input. No flags; requires SUPERMETRY_SITES_FILE.
    supermetry version Print the binary version. No flags.
  3. Run a command. For example, create a backup in the current directory.

    Terminal window
    supermetry backup --out supermetry-backup.tar.gz

    supermetry install --help lists every install flag with examples. --dry-run prints the complete plan without changing anything or connecting to the database, and --apply is internal (it runs a prepared privileged plan). Preview an install like this:

    Terminal window
    supermetry install --dry-run --mode docker --base-url https://analytics.example.com

What you should see: the command prints its result and exits with status 0; the backup example prints Backup written to supermetry-backup.tar.gz.