Skip to main content

Installing Husarnet on Linux

info

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 https://install.husarnet.com/install.sh | 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

Execute:

sudo -i
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

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 https://install.husarnet.com/repo.key

Put the following content in /etc/yum.repos.d/husarnet.repo:

[husarnet]
name=Husarnet
baseurl=https://install.husarnet.com/rpm/
enabled=1
skip_if_unavailable=1
gpgcheck=1
gpgkey=https://install.husarnet.com/repo.key

Continue with the installation:

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 (/):

wget https://install.husarnet.com/tar/husarnet-latest-amd64.tar
#Alternative method
#curl https://install.husarnet.com/tar/husarnet-latest-amd64.tar > 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.