Skip to Content
HostWall

Quickstart

From a fresh VPS to a website protected by HostWall in about 5 minutes: DNS, install, sign in, monitor mode, a test attack and block mode.

This guide takes you from an empty Linux server to a website protected by HostWall in about 5 minutes. You will install HostWall, open the dashboard, add your site in monitor mode, send a harmless test attack, and then switch to blocking.

Note

HostWall is at v0.1. Start every site in monitor mode (the default) and switch to block mode once you have checked for false alarms.

What you need

  • A Linux server with systemd (Ubuntu 22.04+, Debian 12+, Fedora and similar), x86-64 or ARM64. 512 MB of RAM is enough for a small site.
  • SSH access with sudo.
  • A domain name you control, for example example.com.
  • Your app running on the same server or reachable from it, for example on localhost:3000.
  • Ports 80 and 443 free. If nginx, Apache or Caddy already uses them, stop that server or move it to another port and use it as HostWall's upstream.

In the commands below, replace example.com with your domain and localhost:3000 with your app's address.

1. Point your domain at the server

Create an A record (and an AAAA record if your server has IPv6) for your domain that points at the server's public IP address. Then check it from your own computer:

dig +short example.com

The output should be your server's IP. DNS changes can take a few minutes to spread. HostWall can only get an HTTPS certificate once the domain points at the server.

Using Cloudflare? Set the record to DNS only (grey cloud) for now, and read Running behind Cloudflare once the site works.

2. Install HostWall

On the server:

curl -fsSL https://www.hostwall.io/install | sh

The script downloads the latest release, checks its SHA-256 checksum, installs the binary to /usr/local/bin/hostwall, creates a hostwall system user and starts the hostwall systemd service. On first start, HostWall creates a dashboard user called admin with a random password. The script ends by printing it:

[HostWall] Done. HostWall is running.

[HostWall] Dashboard (localhost only):  https://127.0.0.1:9443
           From your computer:  ssh -L 9443:127.0.0.1:9443 you@this-server
           then open https://localhost:9443
[HostWall] Initial username:  admin
[HostWall] Initial password:  K7Q2-9XMP-HD4W-3VZT
           You'll choose a new password when you first sign in.

Lost it? It is kept in a file only root and the service can read, and it is printed in the log on every start until you change it:

sudo cat /var/lib/hostwall/initial-admin.txt
sudo journalctl -u hostwall | grep "Initial password"

If you use a firewall, open ports 80 and 443 and keep port 9443 closed:

sudo ufw allow OpenSSH
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp

More install options (Docker, manual, from source, Windows and macOS) are in the install guide.

3. Open the dashboard through an SSH tunnel

The dashboard listens only on 127.0.0.1:9443 on the server, so it is not exposed to the internet. Reach it with an SSH tunnel from your own computer:

ssh -L 9443:127.0.0.1:9443 you@your-server

Keep that SSH session open and browse to https://localhost:9443.

The dashboard uses a self-signed certificate, so your browser shows a warning the first time. That is expected: the connection is still encrypted, and it only travels through your SSH tunnel. Accept the warning to continue.

Prefer to reach the dashboard directly? See Dashboard access. The tunnel is the safer default.

4. Sign in and add your site

  1. Sign in with username admin and the initial password.

  2. Choose a new password of at least 10 characters. HostWall asks for this before anything else, and deletes initial-admin.txt once you have.

  3. Protect your first site:

    • Domain: example.com.
    • App address: localhost:3000. HostWall checks that the domain resolves and that your app answers.
    • Protection mode: keep Monitor first.

    Click Protect site.

  4. Turn on two-factor sign-in (optional, strongly recommended): go to Settings, click Turn on two-factor sign-in, scan the QR code with an authenticator app (1Password, Bitwarden, Google Authenticator, Authy and so on) and enter the 6-digit code. From then on, signing in asks for a code too.

More detail: First sign-in and Add a site.

5. Check that the site works

Open https://example.com in your browser. HostWall gets a free Let's Encrypt certificate in the background, usually within a minute. Plain http:// requests are redirected to https://.

The Sites page shows the certificate status. If the certificate doesn't arrive, see Certificate not issued.

Now make sure visitors can't skip HostWall by going straight to your app. If your app listens on all interfaces (0.0.0.0:3000), make it listen on 127.0.0.1 only, or block port 3000 in your firewall.

6. Send a harmless test attack

From your own computer, send a request that looks like a SQL injection. It doesn't harm anything:

curl -s -o /dev/null -w "%{http_code}\n" "https://example.com/?id=1%27%20OR%20%271%27%3D%271"

Because the site is in monitor mode, the request goes through to your app and you see your app's normal status code (usually 200). HostWall records what it would have blocked.

A few more harmless examples:

curl -s -o /dev/null -w "%{http_code}\n" "https://example.com/?q=%3Cscript%3Ealert(1)%3C/script%3E"
curl -s -o /dev/null -w "%{http_code}\n" "https://example.com/?file=../../../../etc/passwd"

7. Review what HostWall saw

In the dashboard, open Attacks. Your test requests are listed as Would block, with the attack type (for example SQL injection) and your IP address.

Click an event to see Why would this be blocked?: a plain-language summary, the rules that matched, where in the request they matched, and the anomaly score. If a real visitor or your own app ever shows up here, use Allow this to create a narrow exception. See Handling false alarms.

You can see the same events on the server:

sudo hostwall logs

Leave the site in monitor mode for a while (a few days of normal traffic is ideal) and check the Attacks page for anything that looks like real use of your site.

8. Switch to block mode

When you are happy, go to Sites and set the site's mode to Block. Or, on the server:

sudo hostwall site mode example.com block

Send the test request again:

curl -s -o /dev/null -w "%{http_code}\n" "https://example.com/?id=1%27%20OR%20%271%27%3D%271"

This time you get 403. In a browser, the visitor sees a short "Request blocked" page with a reference code. That code is the request ID, and you can search for it on the Attacks page.

Your site is protected.

Next steps

Edit this page on GitHub

On this page