Skip to main content

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.

The simplest way to install Husarnet is to paste the following line into your terminal:

curl -s | sudo bash

That's all.

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:

sudo -i
curl | apt-key add -
echo 'deb all husarnet' > /etc/apt/sources.list.d/husarnet.list

On Ubuntu 21.10, Debian 11 and newer versions execute

sudo -i
curl > /usr/share/keyrings/husarnet.gpg
curl > /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:

sudo -i
rpm --import
curl > /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 (/):

#Alternative method
#curl > husarnet-latest-amd64.tar
sudo tar --directory=/ --no-same-owner --dereference -xf husarnet-latest-amd64.tar

(replace -amd64 with -armhf or -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.