Command line
Use HF Server from a terminal with the hostfog command, and connect HF Server to your HF Panel servers to share sites through them.
HF CLI, the hostfog command, does everything HF Server does from a terminal. It talks to the running app, and starts
it when it isn't running.
Where: a terminal or command prompt
Install the command
| System | How |
|---|---|
| Windows | the installer adds hostfog.exe to your PATH; open a new command prompt |
| Linux (.deb) | installed as /usr/bin/hostfog |
| Linux (.tar.gz) | install.sh links ~/.local/bin/hostfog |
| macOS | run once: sudo ln -sf "/Applications/HF Server.app/Contents/MacOS/hostfog-panel" /usr/local/bin/hostfog |
Run hostfog help for the full list. Add -y to skip "are you sure" questions.
Commands
| Command | What it does |
|---|---|
hostfog status |
servers, ports and warnings, and new caught emails |
hostfog start [apache|nginx|mysql|redis|postgres] |
starts servers (Apache and MySQL when none is named) |
hostfog stop [...] / hostfog restart [...] |
stops or restarts servers |
hostfog sites |
your sites and their addresses |
hostfog new <kind> <name> [source] |
makes a new site; kinds: blank, wordpress, laravel, symfony, codeigniter, cakephp, drupal, yii, slim, react, next, vue, svelte, astro, preact, vite, static, zip, git |
hostfog open [site|phpmyadmin|htdocs|logs] |
opens a site, phpMyAdmin or a folder |
hostfog share <site> |
shares a site through HF Tunnel and prints the link |
hostfog unshare <site> |
stops sharing |
hostfog db [list] |
lists databases |
hostfog db create|drop|backup <name> |
creates, deletes or backs up a database |
hostfog db import <name> <file.sql> |
imports a .sql file |
hostfog db tables <name> |
lists a database's tables |
hostfog db query <name> "SELECT …" |
runs a query |
hostfog mail [clear] |
lists caught emails, or deletes them all |
hostfog logs [apache-error|apache-access|php-error|mysql-error|panel] [--lines N] [-f] |
shows a log; -f follows it |
hostfog ssl |
trusts the local HTTPS certificate |
hostfog update [install] |
checks for (and installs) new versions |
hostfog uninstall [--keep-sites] |
removes HF Server's data and settings |
hostfog quit |
closes HF Server |
hostfog version |
prints the version |
Example:
hostfog new wordpress blog
hostfog share blog
hostfog db query blog "SELECT ID, post_title FROM wp_posts LIMIT 5"
Connect to an HF Panel server
HF Server can save your HF Panel servers (HF Sync), check that they are online, list their sites and databases, and share a local site through your own server's HF Tunnel instead of the free service.
Make an API token
On the HF Panel server, open Control Panel › Account › Password & security and make an API token. To share sites
through the server, the token must be a Read & change token. Administrator and reseller tokens work too; then name
the hosting account with --account.
Add the server
hostfog servers add https://panel.example.com:8443 hf_xxxxxxxx --name myserver
| Option | What it does |
|---|---|
--name N |
the name you use for the server in other commands |
--account A |
for administrator or reseller tokens: which hosting account to use |
If the server's certificate is self-signed, the command shows its SHA-256 fingerprint and asks before trusting it. Check the fingerprint on the server first. A trusted fingerprint is pinned: the connection fails if the certificate changes.
Use the server
| Command | What it does |
|---|---|
hostfog servers |
your saved servers and whether they are online |
hostfog servers sites <server> |
the server's sites (domain, address, PHP version) and databases |
hostfog share <site> --server <server> [--name <link>] |
shares the site at https://<link>.<tunnel domain> through that server |
hostfog servers remove <server> |
forgets the server |
Sharing through your server makes (or reuses) a tunnel on your hosting account. HF Tunnel must be switched on on the server; see Tunnels on your own server.