Skip to main content

Configuration guide for Self-hosted Dashboard and Base Servers

About

Husarnet Dashboard and Husarnet Base Server are hosted by the Husarnet company, but the special version of them can be hosted on your own infrastructure.

To install Husarnet Dashboard and Husarnet Base Server you need to prepare at least two machines with "publicly-accessible" IP (in case of LANs, it just means that it needs to be accessible by any computer in the network without any NATs in between). The self-hosted Dashboard and Base Server can be installed on any Docker-compatible machine, but Ubuntu 20.04+ or Debian buster+ is strongly recommended. Customers interested in deploying self-hosted version in their infrastructure have to contact us via email at contact@husarnet.com. After agreeing on a plan, our Integration Team will walk you through the installation process.

Connecting clients to self-hosted Husarnet

Linux client

sudo husarnet setup-server <address>
sudo systemctl restart husarnet

Where <address> is the hostname or IP address of the dashboard, e.g. sudo husarnet setup-server 192.168.1.100, or sudo husarnet setup-server app.mydomainwheredashboardisinstalled.com.

To use the default Husarnet server by your Linux client go to /var/lib/husarnet and remove license.json file, then execute sudo systemctl restart husarnet on the devices you want to connect.

ESP32 client

ESP32 client supports self-hosted instances since Arduino library version 1.2.0. The supports is implemented as Husarnet.selfHostedSetup() method call. Before calling Husarnet.join(), or Husarnet.start(), one has to call Husarnet.selfHostedSetup(), e.g.:

Husarnet.selfHostedSetup("192.168.1.100");
Husarnet.join("<my-joincode>", "esp32");
Husarnet.start();

The Husarnet library saves the license file in the ESP32 memory, so in theory you do not need to call Husarnet.selfHostedSetup() later again. However, because the license file usually have short validity period, it's best to call selfHostedSetup() before each start() to make sure the license is always fresh.

To use the default Husarnet servers again, call:

Husarnet.selfHostedSetup("default");