Skip to Content
HostWall
CLI

run, validate, reload, status

hostwall run, validate, reload and status: start HostWall, check and apply configuration, and see what's running.

run

Start HostWall in the foreground: the HTTP and HTTPS listeners, the WAF, the dashboard and (if configured) the metrics endpoint. Stop it with Ctrl+C or SIGTERM; it finishes in-flight requests for up to 15 seconds.

FlagMeaning
--debugVerbose logging
sudo hostwall run
hostwall run --config examples/local/hostwall.yaml

On Linux with the install script, systemd runs this for you as hostwall run --config /etc/hostwall/hostwall.yaml --data /var/lib/hostwall. Use sudo systemctl start|stop|restart hostwall instead of running it by hand.

All ports are opened before anything starts, so problems such as a port already in use are reported straight away, for example:

hostwall run: http listener on :80: listen tcp :80: bind: address already in use

On first start, run creates the dashboard user admin with a random password, writes it to <data_dir>/initial-admin.txt (mode 0600) and prints it. It prints it again on every start until you choose your own password:

[HostWall] Dashboard:          https://127.0.0.1:9443
[HostWall] Initial username:   admin
[HostWall] Initial password:   K7Q2-9XMP-HD4W-3VZT
[HostWall] You'll choose a new password when you first sign in.

validate

Check the config file without touching the running server.

sudo hostwall validate
sudo hostwall validate --config ./new-hostwall.yaml

Output:

✔ /etc/hostwall/hostwall.yaml is valid (2 site(s) in the file)

If there is no file at the path, it says so and exits with 0: HostWall runs fine with defaults. Errors name the key and the problem, for example:

hostwall validate: /etc/hostwall/hostwall.yaml: site "example.com": mode must be monitor, block or off, not "blok"

reload

Ask a running HostWall to re-read its config file and dashboard sites.

sudo hostwall reload
Reload requested. A running hostwall applies it within 2 seconds (no downtime).

reload first validates the config file. If it's invalid, nothing is reloaded:

hostwall reload: config is invalid, nothing reloaded: ...

You often don't need reload: HostWall notices changes to the config file by itself within about 2 seconds, and changes made in the dashboard or with hostwall site apply immediately. Listener and tls changes need a restart; see How changes apply.

status

Show whether HostWall is running, where its data is, and each site's traffic over the last 24 hours.

sudo hostwall status
● hostwall v0.1.0 is running (up 3m12s)
  data: /var/lib/hostwall
  config: /etc/hostwall/hostwall.yaml

SITE             MODE     UPSTREAM               SOURCE     REQUESTS 24H  BLOCKED  MONITORED
example.com      block    http://localhost:3000  file       18204         37       0
api.example.com  monitor  localhost:8080         dashboard  5120          0        12

"Running" means the server wrote a heartbeat to the database in the last 30 seconds. Until the initial admin password is changed, status also prints:

  dashboard: initial password not changed yet (see /var/lib/hostwall/initial-admin.txt)
Edit this page on GitHub

On this page