hearthgate docs

Command line

Run these commands as root or as the hearthgate user, because they open the database in the data directory.

CommandWhat it does
hearthgate runRun the gateway (what the service starts)
hearthgate validate [FILE]Check a desired-state file, or the current state
hearthgate apply FILE [-m MESSAGE] [--dry-run]Store a file as a new revision and show the diff
hearthgate export [-o FILE] [-r N]Print the current (or an older) state as TOML
hearthgate import FILERestore an exported file (same as apply)
hearthgate statusCurrent revision and interfaces
hearthgate revisionsHistory, newest first
hearthgate diff A [B]What changed between two revisions
hearthgate rollback NMake revision N current again, as a new revision
hearthgate cert import/list/removeUploaded certificates
hearthgate admin-tokenPrint the admin API token
hearthgate setup-codePrint the code for creating the first dashboard account
hearthgate admin-access [--reset]Show who can reach the dashboard, or reset that to the default
hearthgate firewall statusWhether the firewall is installed, and whether a change waits for confirmation
hearthgate firewall confirmKeep the waiting firewall change (run it from a new SSH session)
hearthgate firewall offTurn the firewall off as a new revision (a running Hearthgate then removes its table)
hearthgate vpn statusVPN settings, devices and their last handshake
hearthgate vpn enable [--endpoint HOST], hearthgate vpn disableTurn the VPN on or off as a new revision
hearthgate vpn add NAME [--access all|SVC,SVC] [-o FILE]Add a device and print its configuration and QR code once
hearthgate vpn remove NAMERemove a device; it can't connect any more
hearthgate docker statusManaged containers and stacks
hearthgate docker logs NAME [-n N]A managed container's recent output
hearthgate docker update NAMEPull the newest image of a container or stack and recreate it if it changed
hearthgate docker check-updatesWhether newer images exist, without changing anything
hearthgate backup create [-o FILE]Write a backup now
hearthgate backup listBackups in the backup directory
hearthgate backup restore FILE [--force]Restore a backup (stop the service first)
hearthgate openapiPrint the admin API's OpenAPI document

--data-dir (or HEARTHGATE_DATA_DIR) points any command at another data directory, which is handy for trying things out without root.

apply and rollback never rewrite history: rolling back to revision 3 creates a new revision with revision 3's content. Applying a file equal to the current state creates nothing.

Edit this page on GitHub Hearthgate 1.0