Skip to content

Debian

keen-pbr is installed on Debian from the keen-pbr APT repository. Run the commands over SSH or in the server terminal as root (or with sudo).

Add the repository

Open the keen-pbr repository page, select the OS Debian on the left, then your release and architecture. Run the commands it shows, in order: they add the signing key and the apt package source.

Install the package

bash
apt update
apt install keen-pbr

# version without the web UI and API:
# apt update
# apt install keen-pbr-headless

The configuration is in /etc/keen-pbr/config.json. The service starts right away and starts at every system boot.

keen-pbr-headless takes less space: about 1.2 MB instead of 2.8 MB. It has no web UI and no API, so you configure it through the config file. If in doubt, install the regular keen-pbr.

Check that the service is running

bash
systemctl status keen-pbr

If everything is fine, the output contains active (running).

Open the web UI

Open http://<server-ip>:12121 in your browser. The headless version has no web UI.

Set up your first rules

Go to the Quick Start page and open the Web UI tab. If you installed keen-pbr-headless, open the JSON tab.

If there are no ready-made packages for your platform, build keen-pbr yourself: Build from Source.

Service commands

bash
systemctl start keen-pbr
systemctl status keen-pbr
systemctl restart keen-pbr

Separate DNS servers for lists (dnsmasq)

dnsmasq is not needed for routing. It is a DNS server installed on the system next to keen-pbr. Install it if you want to send the domains of some lists to separate DNS servers, or set your own main DNS servers. See Do I need dnsmasq?.

Install dnsmasq

bash
apt install dnsmasq

To apply the recommended dnsmasq settings, run:

bash
/usr/lib/keen-pbr/dnsmasq-hook.sh install-recommended-config

It replaces /etc/dnsmasq.conf and saves the previous file as /etc/dnsmasq.conf.backup-keenpbr. dnsmasq then answers only your local networks and takes its servers from keen-pbr.

Then, in the Web UI, open General > Settings > Local DNS server management and turn on Manage dnsmasq configuration. Point the system resolver (or your DHCP server) at dnsmasq if it is not already used.

Return to how it was

  1. Turn off Manage dnsmasq configuration and apply the config. dnsmasq restarts and uses the servers from /etc/keen-pbr/dnsmasq-fallback.conf. If dnsmasq has servers of its own, these are added to them; clear the file to avoid that.
  2. Restore the system resolver you used before dnsmasq.
  3. If you ran install-recommended-config, put the old settings back:
    bash
    cp /etc/dnsmasq.conf.backup-keenpbr /etc/dnsmasq.conf
    systemctl restart dnsmasq
  4. Or remove the package:
    bash
    apt remove dnsmasq