HF PanelDocsv1.0.0

Server commands

Every hf-panel command for administrators — logins, panel data, DNS and mail, separate panels, repairs, extra servers and removal.

hf-panel is the administrator's command on the server. Log in over SSH and run it as root (or with sudo). hf-panel help prints the list of commands.

bash
sudo hf-panel help

Note: hf-admin, the command's old name, still works. An unknown command prints the help and exits with status 1.

Summary

Command What it does
create-admin create an administrator login
reset-password <user> set a new password for a panel login
reset-2fa <user> switch off two-factor login for a login (lost phone)
list list every panel login
panel-backups list the copies of the panel's own data
panel-backup make a copy now
panel-restore <name> put a copy back
backup-panel make the encrypted panel backup now and copy it to your backup storage
backup-panel-list list the encrypted panel backups on this server
restore-panel <file|name|remote> rebuild the panel from an encrypted backup (disaster recovery)
dns-setup [--check] the DNS records the server's own domain needs
mail-name <name> use another mail server name
mail-autoconfig (re)create mail-app auto-setup
company-mail apply [file] create missing company mailboxes and forwarders
ssl-now get or renew the panel's SSL certificate now
portals [on|off] show or switch the separate panels
status-page on|off the public status page on its own address
files-portal on|off HF Files on its own address
db-portal on|off HF Studio on its own address
api-portal on|off the API on its own address
health check the whole server
apache-fix repair and start Apache
php-versions PHP versions this server can install
php-repo add the extra PHP versions repository
licence features what your plan includes and what this server is set up for
licence sync [--if-changed] check the licence now and make the server match your plan
node-enable <main IP> let a main server add this one as an extra server
node-disable stop being an extra server
uninstall remove the panel
delete remove HF Panel and all data

Admin logins

create-admin

bash
hf-panel create-admin

Asks for an Admin username (3–32 characters: a letter first, then letters, numbers, _, . or -), an Admin email and a password (twice). A typing mistake asks again, up to five times. The new login is a full administrator and signs in to Server Admin.

The installer runs this command at the end. Run it yourself after an install without a keyboard, or to add another administrator. Server Admin › Accounts › Staff logins also adds administrator logins, including read-only ones.

reset-password

bash
hf-panel reset-password sarahbakes

Asks for a new password (twice) for any panel login: administrator, reseller or customer. Failed sign-in attempts are forgotten, so a locked-out login can sign in again at once. The account's SFTP password does not change.

reset-2fa

bash
hf-panel reset-2fa sarahbakes

Switches off two-factor login for a login whose phone is lost, and forgets failed sign-in attempts. The person signs in with their password and can switch two-factor login on again.

list

bash
hf-panel list

Lists every panel login, sorted by role: username, role (admin, reseller, client), status and email.

Control panel data

The panel's own data — accounts, packages, invoices, settings, tickets — is in one database. A copy is made every night and kept on the server in /var/lib/hostfog/panel-backups/ (and sent off the server when off-server backups are on). These commands work with those copies. They don't touch websites, mail or databases.

panel-backups

bash
hf-panel panel-backups

Lists the copies, newest first, with their name (for example panel-20261024-032001.sqlite.gz), size and date.

panel-backup

bash
hf-panel panel-backup

Makes a copy now and prints its file name. Make one before a big change or an update.

panel-restore

bash
hf-panel panel-restore panel-20261024-032001.sqlite.gz
hf-panel panel-restore panel-20261024-032001.sqlite.gz --yes   # don't ask

Puts a copy back. Give a name from panel-backups, or a full path to a copy.

  1. The copy is unpacked and checked, and the command shows when and on which server it was made, by which version, and how many logins it has.
  2. It asks you to type yes. Everything changed in the panel since the copy was made is lost.
  3. The current data is kept as /var/lib/hostfog/hostfog.before-restore-<date>.sqlite, then the copy takes its place and the database is brought up to the installed version.

If the settings file was different when the copy was made, the old one is saved as /var/lib/hostfog/panel-backups/config.from-backup.json. Copy it over /etc/hostfog/config.json if saved passwords or keys don't work after the restore.

Run it as root.

backup-panel

bash
sudo hf-panel backup-panel
sudo hf-panel backup-panel-list

backup-panel makes the encrypted panel backup now, as the nightly job does, and copies it to the backup storage chosen on the Panel backup screen. It needs the passphrase set there. backup-panel-list lists the files kept on this server.

restore-panel

bash
sudo hf-panel restore-panel panel-full-20261024-020000.hfpa
sudo hf-panel restore-panel remote --host old-server --system

Puts an encrypted panel backup back on a fresh install: the database, the settings file and the server key, and with --system the files in /etc/hostfog and the nginx configs. Give a file name from backup-panel-list, a full path, or remote to fetch the newest copy from the backup storage.

Option What it does
--system also restore /etc/hostfog and the panel's nginx configs (nginx is tested; the old files return if it refuses)
--host NAME with remote: the old server's panel host name, whose folder holds the copies
--name FILE with remote: fetch this copy, not the newest
--storage FILE with remote: read the storage settings from a JSON file instead of this panel
--passphrase-file FILE read the passphrase from a file (or set HF_PANEL_PASSPHRASE); otherwise it is asked for
--yes don't ask for confirmation

The current database is kept as hostfog.before-restore-<date>.sqlite and the replaced files in /var/backups/hostfog-config. Run it as root, then restore the customers' accounts from their own backups. The full procedure is on Panel backup.

DNS and mail

dns-setup

bash
hf-panel dns-setup           # the list
hf-panel dns-setup --check   # also look each record up in public DNS

Prints the DNS records the server's own domain needs: A records for the panels, the apps, the mail names, FTP and the nameservers; SPF, DKIM, DMARC and TLS reporting; the glue records to register at your registrar; and the reverse DNS (PTR) to set at your server provider. It also writes them as a zone file you can import, /etc/hostfog/dns-setup.zone.

--check looks up each record in public DNS, marks it as fine, ADD or UPDATE, and exits with status 1 while anything is missing. See DNS setup.

mail-name

bash
hf-panel mail-name mail2.yourdomain.com

Uses another name for the mail server: the MX of every hosted domain, the name it greets other servers with, and the name the reverse DNS must have. The default is mail.yourdomain.com. The server switches to the new name by itself once its DNS points at the server. Then change the reverse DNS (PTR) at your server provider to match.

mail-autoconfig

bash
hf-panel mail-autoconfig

Creates (again) the files mail apps read to set themselves up: Outlook, Thunderbird and phones find their settings from just the email address and password.

company-mail apply

bash
hf-panel company-mail apply
hf-panel company-mail apply /root/my-company-mail.conf

Creates the mailboxes and forwarders listed in a company mail file on the server's own domain, when they are missing. The default file is /usr/local/hostfog/company-mail.conf. Addresses that already exist are kept as they are. Each new mailbox's password is shown once and added to /root/hostfog-mailboxes.txt.

ssl-now

bash
hf-panel ssl-now

Gets or renews the panel's Let's Encrypt certificate now, instead of waiting for the next check (every 5 minutes). The certificate covers every server name whose DNS points at the server. Use it after fixing DNS.

Separate panels

portals

bash
hf-panel portals                         # show them
hf-panel portals on                      # switch them on with the default names
hf-panel portals on --admin admin.yourdomain.com --customer my.yourdomain.com --reseller partners.yourdomain.com
hf-panel portals off                     # back to one panel for everyone

With no argument, shows a table of the separate panels and apps: each one's address, whether its DNS points at the server (ok or add A) and whether it has SSL (ok or after DNS).

Sub-command What it does
on Server Admin at server.yourdomain.com, Control Panel at panel.yourdomain.com, Reseller Panel at reseller.yourdomain.com, each with its own sign-in
on --admin NAME --customer NAME --reseller NAME the same, with names you choose (--client works as --customer)
off one panel for everyone at the classic address, https://panel.yourdomain.com:8443

A name that doesn't point at the server yet gets SSL by itself within 5 minutes of its A record being added.

status-page

bash
hf-panel status-page on                       # at status.yourdomain.com
hf-panel status-page on uptime.yourdomain.com # at a name you choose
hf-panel status-page off                      # only at https://<panel>/status

Puts the public status page on its own address.

files-portal

bash
hf-panel files-portal on [NAME]   # default files.yourdomain.com
hf-panel files-portal off         # only at https://panel.yourdomain.com:8443/files/

Puts HF Files, the File Manager, on its own address, or takes it off.

db-portal

bash
hf-panel db-portal on [NAME]   # default db.yourdomain.com
hf-panel db-portal off         # only at https://panel.yourdomain.com:8443/studio/

Puts HF Studio, the database app, on its own address, or takes it off. The old name studio-portal still works.

api-portal

bash
hf-panel api-portal on [NAME]   # https://api.yourdomain.com:2087/v1
hf-panel api-portal off         # only at https://panel.yourdomain.com:8443/api/v1

Puts the API on its own address, or takes it off. The API is for programs: a browser gets "403 Forbidden".

Repairs

health

bash
hf-panel health

Checks the whole server: services, configuration, disk, memory, SSL, the clock and the mail queue. Each line shows a green tick (ok), a yellow ! (warning) or a red cross (problem); lines that the panel can fix say "(fix in the panel: Server health)". It ends with a count of what is ok, the warnings and the problems. Server Admin › Server › Server health also checks DNS, SSL and backups, with one-click fixes.

apache-fix

bash
hf-panel apache-fix

Repairs and starts Apache: a port clash, missing log folders, leftover sites. If Apache still can't start, it prints Apache's own error.

php-versions

bash
hf-panel php-versions

Lists the PHP versions this server can install. Install them under Server Admin › System › PHP & Node.js.

php-repo

bash
hf-panel php-repo

Adds the extra PHP versions repository, if it supports this system's release.

Licence plan

licence features

bash
hf-panel licence features

Shows the features your licence's plan includes (from the panel's last licence check) and the features this server's software is set up for. The two differ until the next sync after a plan change.

licence sync

bash
hf-panel licence sync
hf-panel licence sync --if-changed   # only when the plan changed (the daily run)

Asks the licence server now, then makes the server match your plan. It prints each added (+) and removed (-) feature, every change it makes, and a count at the end.

Your plan gained What the sync does
Email, DNS starts the mail or DNS server again. When it was never installed, downloads HF Panel from the licence server (the same download as HF Panel updates) and runs the installer again with your saved settings
Reseller Panel, HF Files, HF Studio, API adds that part's own address again (reseller., files., db., api.)
HF Studio starts PostgreSQL and MongoDB databases again, or installs them
HF Tunnel, Docker starts the tunnel server or Docker again, when they were set up before
Apps starts the customers' apps again, and installs Node.js, Ruby, Perl modules, PEAR and Composer if missing

When your plan loses a feature, the sync stops and switches off its services (they no longer start at boot), closes its firewall ports and removes its own address. The panel hides the feature's screens.

Important: data is never deleted. Mailboxes, DNS zones, databases, tunnels, Docker images and apps' files stay on the server, and come back when the feature is in your plan again.

Every step checks first, so the sync can run any number of times. A part you left out with an installer option (--no-mail, --no-dns, --no-portals) is never added. Root's daily scheduled job runs hf-panel licence sync --if-changed, so a plan change reaches the server within a day; Check now on Server Admin › Billing › Licence checks the licence straight away. The official edition includes every feature, so the sync has nothing to do there.

More servers

node-enable

bash
hf-panel node-enable 203.0.113.10
hf-panel node-enable 203.0.113.10 --new   # a new join code

Run this on an extra server, with the IP address of the main HF Panel server (several addresses may be given, separated by commas or spaces). The extra server then accepts commands from the main one, and prints a join code. Paste the code on the main server under Server Admin › Accounts › Servers › Add server.

The code stays the same each time you run the command; --new makes a new one. Keep it secret: it lets that panel manage this server.

node-disable

bash
hf-panel node-disable

Stops accepting commands from a main panel.

Install, update, remove

Install or update

bash
cd /home && curl -o latest -L https://get.hostfog.io/latest && sudo bash latest [options]

Installs HF Panel, or updates an installed one. Options:

Option What it does
--hostname panel.yourdomain.com the server's own name; every other address uses the same domain
--email you@yourdomain.com the administrator's email (SSL notices)
--company "Name" the company name
--mail-host mail.yourdomain.com the mail server's name
--port 8443 the panel port
--ns1 NAME --ns2 NAME the nameservers' names
--node 24 the Node.js version, 18 or newer
--no-mail no email
--no-dns no DNS server
--no-portals one panel for everyone
--quotas hard disk quotas
--licence KEY the licence key

See Customise the installation and Updating.

uninstall

bash
hf-panel uninstall                       # remove the panel, keep websites, databases and mail running
hf-panel uninstall --purge               # also delete all hosting accounts
hf-panel uninstall --purge --packages    # also remove Nginx, Apache, PHP, MariaDB, mail and DNS software
Option What it does
--purge also delete every hosting account; asks you to type DELETE EVERYTHING
--packages also remove the server software; only together with --purge
--yes don't ask Continue? (for scripts); --purge still asks for the confirmation words
--help show the options

delete

bash
hf-panel delete

Removes HF Panel and all data: accounts, databases, mail, certificates, logs, software and backups. Nothing is saved. Asks you to type DELETE EVERYTHING. See Uninstalling.

Other commands for administrators

Command What it does
/usr/local/hostfog/bin/hf-api config get|set|set-text|unset|show … read and change the settings file (see Settings)
sudo -u hostfog /usr/local/hostfog/bin/hf-api notify server-ready --force send the "server is ready" email again
/usr/local/hostfog/bin/hf-api restart restart the panel program without a gap