Installing Husarnet on Linux
Husarnet CLI and Husarnet Daemon come as one package and are not meant to be installed separately.
There are multiple ways of installing Husarnet on your machines. Please follow only one of them.
I. Single command (recommended)
The simplest way to install Husarnet is to paste the following line into your terminal:
curl -s https://install.husarnet.com/install.sh | sudo bash
This method works on APT and Yum based Linux distributions such as Debian, Ubuntu, CentOS, RHEL, Fedora or Mint.
II. Setting up the Debian/Ubuntu repository manually
You can also set up Debian (works for all reasonably new versions of Ubuntu and Debian) repository manually:
sudo apt update && sudo apt install -y curl apt-transport-https
On Ubuntu 20.04, Debian 10 and older versions execute:
curl https://install.husarnet.com/repo.key | apt-key add -
echo 'deb https://install.husarnet.com/deb/ all husarnet' > /etc/apt/sources.list.d/husarnet.list
On Ubuntu 21.10, Debian 11 and newer versions execute
curl https://install.husarnet.com/repo.gpg > /usr/share/keyrings/husarnet.gpg
curl https://install.husarnet.com/husarnet_deb.repo > /etc/apt/sources.list.d/husarnet.list
And now continue with installation
sudo apt update && sudo apt install -y husarnet
III. Setting up the Yum repository manually
You can also set up the Yum repository manually:
rpm --import https://install.husarnet.com/repo.key
curl https://install.husarnet.com/husarnet_rpm.repo > /etc/yum.repos.d/husarnet.repo
yum install -y husarnet
IV. Totally manual binary installation (advanced)
Warning: this is not the recommended installation method. You won't get automatic software updates this way!
If your Linux distribution is not supported by the one-command install method, you can also download the binary package. For most seamless experience, it is recommended to unpack it in the root directory (
#curl https://install.husarnet.com/tgz/husarnet-latest-amd64.tar > husarnet-latest-amd64.tar
sudo tar --directory=/ --no-same-owner --dereference -xf husarnet-latest-amd64.tar
-i386 if you don't have 64-bit Intel/AMD processor)
If you are using systemd, enable and start the service (
systemctl enable husarnet; systemctl start husarnet). Otherwise, make sure
husarnet daemon command is started on system startup. You need to run it as root, but don't worry - Husarnet automatically relinquishes unnecessary permissions.