HestiaCP hardening checklist: lock down port 8083, 2FA, fail2ban, off-server backups and mail DNS

A fresh HestiaCP server answers on port 8083 to the whole internet, so the panel login is a brute-force target from day one. Here is the short checklist I run on every new install, with the stock v-* CLI commands.

Scope: written for HestiaCP 1.9.x on Debian 12 / Ubuntu 24.04. Run any v-* command with no arguments to print its usage on your version, and check it before you paste anything.

1. Restrict the panel port

List the current rules first:

v-list-firewall

You will see the default rule that accepts 0.0.0.0/0 on 8083. Add an allow rule for your own IP, then delete the open one by its rule number:

v-add-firewall-rule ACCEPT 203.0.113.10 8083 TCP "Admin office"
v-delete-firewall-rule RULE_NUMBER

Syntax is ACTION IP PORT [PROTOCOL] [COMMENT]. Keep your current SSH session open while you do this, and make sure you have console access to the server. If your IP changes often, use a VPN with a fixed address instead of opening the port again.

2. Turn on 2FA for the admin user

Enable it in the panel under your user profile, or from the shell:

v-add-user-2fa admin

Save the recovery codes somewhere that is not the same server.

3. Check that fail2ban is really banning

Hestia ships with fail2ban jails, including one for the panel login. Confirm they are active:

fail2ban-client status
fail2ban-client status hestia

If the list of banned IPs is always empty on a public server, look at why. The log path or the backend may be wrong.

4. SSH: keys only

Add your public key, then in /etc/ssh/sshd_config:

PasswordAuthentication no
PermitRootLogin prohibit-password

Reload with systemctl reload ssh and test from a second terminal before you close the first one.

5. Backups that leave the server

A backup on the same disk is not a backup. Hestia can push to remote storage over SFTP, FTP, B2 or rclone. The command takes the type first, then host and credentials:

v-add-backup-host sftp backup.example.com backupuser 'PASSWORD' /backup 22

Then run a backup by hand and check that the file arrives:

v-backup-user USERNAME
v-list-user-backups USERNAME

The step most people skip is a restore test on a spare box with v-restore-user. Do it once. It is much better to find a broken backup now than during an outage.

6. Mail DNS: verify it, don’t assume

Hestia generates SPF and DKIM records for a mail domain, but the published zone only contains them if Hestia hosts the DNS for that domain. If your DNS is at Cloudflare or a registrar, copy the records from the panel’s DNS section by hand. Then check what the world sees:

dig +short TXT example.com
dig +short TXT mail._domainkey.example.com
dig +short TXT _dmarc.example.com

The DKIM selector may differ on your setup. Add a DMARC record yourself, starting with p=none and reports sent to a mailbox you read.

7. Updates

Keep the OS and Hestia current with apt update && apt upgrade. Enable unattended-upgrades for security patches. Read the Hestia release notes before a major version jump, and take a backup first.

Disclosure: I am posting this on behalf of vpsttt. Everything above works the same on any VPS from any provider.

What would you add or change in this list? I am especially interested in how you handle panel access when your admin IP is dynamic.

If Hestia doesn’t host the DNS I would add at this point that the following records must be created too:

mail              A      "203.0.113.10"
webmail           CNAME  "mail.example.org."
@                 MX     0                    "mail.example.org."

And these SRV records are added by Hestia too but are optional:

_submission._tcp  SRV    1    "0 587 mail.example.org."
_imap._tcp        SRV    1    "0 143 mail.example.org."
_imaps._tcp       SRV    1    "0 993 mail.example.org."
_pop3._tcp        SRV    1    "0 110 mail.example.org."
_pop3s._tcp       SRV    1    "0 995 mail.example.org."

My router sets a dynamic DNS record whenever my public IP changes. On my server, I have a script that checks whether the IP has changed. If it has, the script adds a firewall rule allowing that IP to access Hestia’s port (or all of them… or just a range), updates the API_ALLOWED_IP configuration by adding the new IP, and removes the old one. It also updates an ipset allowlist.

I forgot that I also add the dynamic host to the ignore list in fail2ban (it resolves the host to the current ip so no need to do any modification after setting it up).

cat > /etc/fail2ban/jail.d/ignorelist.local <<'EOF'
[DEFAULT]
ignoreip = mydynamichost.example.org
EOF

In the past I’ve used

  • htauth on top of the regular user/password
  • Limiting to a country by using ipset
  • For really security conscious clients, you can block that port at the firewall entirely and tunnel the connection over SSH. (LocalForward) then you just connect to localhost:8083

Or use a VPN with a static ip…