Skip to Content
HostWall
CLI

CLI

The hostwall command-line interface: commands, common flags, running as root and exit codes.

Everything HostWall does goes through one binary, hostwall.

hostwall <command> [flags]
CommandWhat it does
runStart the proxy, WAF and dashboard
validateCheck the configuration file
reloadApply configuration changes to a running HostWall
statusShow whether HostWall is running, its sites and recent traffic
siteAdd, list, remove or change protected sites
logsShow security events (blocked and monitored requests)
backupWrite config, data and certificates to one file
restoreRestore from a backup file
admin resetGive admin a new random password and turn 2FA off, for example after losing your phone
upgradeUpgrade to the latest signed release
versionPrint version information
helpShow the command list

Run hostwall <command> --help to see a command's flags.

Common flags

Every command except version and help accepts:

FlagDefaultMeaning
--config <file>/etc/hostwall/hostwall.yaml on Linux (see file locations)Config file. Also settable with HOSTWALL_CONFIG.
--data <dir>server.data_dir, else /var/lib/hostwall on LinuxData directory. Overrides server.data_dir.

Flags can be written as --flag value, --flag=value or -flag value.

Running commands as root

On Linux, the data directory belongs to the hostwall user and isn't readable by others. Run CLI commands with sudo:

sudo hostwall status

When run as root, the CLI switches to the owner of the data directory (the hostwall user) before it opens the database, so files it creates stay usable by the service. Without sudo, commands that read the database fail with no hostwall database in /var/lib/hostwall.

Exit codes

CodeMeaning
0Success (also for --help)
1The command failed. The error is printed as hostwall <command>: <error>.
2Wrong usage, or an unknown command. Usage help is printed.

Edit this page on GitHub

On this page