How to Install and Configure Hamachi in Ubuntu

LogMeIn Hamachi is a zero-configuration Virtual Private Network (VPN) that works with your existing firewall and allows you to access your computer no matter where you are, as long as there is an Internet connection.

While there is a nice interface for the Windows version, Linux users can only access Hamachi via the command line interface. Nevertheless, with some help from the open-source community, Linux users can now easily install, configure and use Hamachi. This tutorial demonstrates the process for Ubuntu.

Tip: if you can't get the Ubuntu terminal to open to run commands, we have a few fixes for you.

How Hamachi Works

At its core, Hamachi is a proprietary VPN adapter that provides a virtual LAN through an overlay network.

Hamachi Ubuntu Install 02 Hamachi Website
Image source: Hamachi

Unlike traditional VPNs, such as NordVPN (see our NordVPN review for reference), Hamachi does not route any Internet traffic in and out of its servers. Instead, it allows you to create a secure, closed LAN between different computers, as Hamachi is useful in instances where you want to share a network service without exposing your host computer. For example, you can use it to start an SFTP server and share its contents only to a select few computers.

Hamachi Ubuntu Install 03 Sample Ftp Server

This Virtual LAN approach also allows you to use Hamachi for both peer-to-peer and local server gaming, making Hamachi invaluable for users who want to play games on Linux over the Internet without porting forward their connections.

Hamachi Ubuntu Install 04 Sample Multiplayer Game

Installing Hamachi in Ubuntu

  1. Download Hamachi's .deb package from the developer's website with the following command. (The Hamachi client software does not exist in the Ubuntu Software Repository.)
Hamachi Ubuntu Install 05 Wget Client Download
  1. Install the Hamachi package through dpkg with the following command. Unlike apt, dpkg is a manual package manager for Debian and Ubuntu.
sudo dpkg -i ./logmein-hamachi_2.1.0.203-1_amd64.deb
  1. Check whether you have properly installed Hamachi by running sudo hamachi help.
Hamachi Ubuntu Install 06 Client Help

Configuring Hamachi in Ubuntu

  1. Start setting up Hamachi on your Ubuntu machine. Configuring the program requires you to have a valid Hamachi account, which you can sign up for from the LogMeIn registration page.
Hamachi Ubuntu Install 07 Register Logmein Account
Image source: Hamachi
  1. Once you have a valid account, you can use the Hamachi CLI to connect to the LogMeIn network:
sudo hamachi login
Hamachi Ubuntu Install 08 Initialize Client
  1. Create a new Hamachi network from the command line. For example, I am running the following command to create a new network using the name "MySecretNetwork1."
sudo hamachi create mysecretnetwork1 verysecurepassword
Hamachi Ubuntu Install 09 Create New Network
  1. With a network up and running, use the Hamachi CLI to connect two machines – install Hamachi on a separate computer and use the join command:
sudo hamachi join mysecretnetwork1 verysecurepassword
Hamachi Ubuntu Install 10 Join New Network

Lastly, it is also possible to evict and delete an existing Hamachi network. For example, running the following commands will evict a peer using its Client ID and delete the network:

sudo hamachi evict mysecretnetwork1 088-167-874
sudo hamachi delete mysecretnetwork1
Hamachi Ubuntu Install 11 Delete New Network

Managing a Hamachi Network With the Haguichi GUI

Aside from directly using the terminal, it is possible to use Haguichi to create and manage a Hamachi network. This third-party GUI wraps around the Hamachi CLI client and presents its functions in a desktop window, which is useful if you are a new user and still not comfortable with the Bash command line.

To install the Haguichi GUI, follow the steps below.

  1. Add the Haguichi repository to your Ubuntu machine:
sudo add-apt-repository -y ppa:ztefn/haguichi-stable
Hamachi Ubuntu Install 12 Add New Repository
  1. Run the following commands to update your machine's repository files and install the Haguichi GUI:
sudo apt update
sudo apt install haguichi
  1. Run the Haguichi GUI by pressing Win and typing "haguichi."
Hamachi Ubuntu Install 13 Run Gui Client
  1. A window will open, asking you to configure your Hamachi client. Press the green "Configure" button to proceed.
Hamachi Ubuntu Install 14 Configure Haguichi
  1. The Haguichi GUI will create an account for your machine and display information about the current Hamachi version on your system.
Hamachi Ubuntu Install 15 Haguichi Landing Screen
  1. Click the "+" button in the title bar of the Haguichi GUI to open the menu that allows you to join or create a network, then click "Create Network."
Hamachi Ubuntu Install 16 Create Network Button
  1. A small prompt will open, asking for the details of your new network. I am naming it "MySecretNetwork1" and providing a secure password.
Hamachi Ubuntu Install 17 Enter New Network Details
  1. With Haguichi running, connect other machines to your new network by clicking the "+" button and selecting "Join Network."
Hamachi Ubuntu Install 18 Join New Network
  1. You will see a small prompt where you can provide your network details. In my case, I will connect to "MySecretNetwork1."
Hamachi Ubuntu Install 19 Enter Join Network Details

Frequently Asked Questions

Is it possible to install Haguichi on non-Ubuntu systems?

Yes! While Haguichi is primarily available for Ubuntu and Debian systems, it is also possible to install this program on other Linux distributions. For example, you can run sudo dnf copr enable ztfen/hacuighi && sudo dnf install haguichi to install the program in Fedora.

Further, Haguichi is also available in Flathub as a distribution-independent package that you can install with: sudo flatpak install flathub com.github.ztefn.haguichi.

I cannot include the Haguichi PPA in my system.

This most likely happens due to an issue between your Internet provider and your machine's IPv6 address resolver. By default, the Ubuntu Launchpad PPA system uses IPv6 when adding and removing repositories, which means that Ubuntu will use IPv6, whether or not your network connection can support it.

This connection mismatch can be an issue if your current network provider does not support IPv6. To fix this, disable your system's IPv6 support by running sysctl: sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1 to force Ubuntu to route every connection it makes to IPv4 instead.

Is it possible to manage my Hamachi clients outside of my Ubuntu machine?

Yes! It is possible using the attach-net command along with your LogMeIn e-mail address: sudo hamachi attach-net ramces@email.invalid.

That will link every Hamachi network you created in your Ubuntu machine to your online LogMeIn account, allowing you to remotely manage these networks even if your Ubuntu machine is offline.

Image credit: Unsplash. All alterations and screenshots by Ramces Red.

Ramces Red
Ramces Red - Staff Writer

Ramces is a technology writer that lived with computers all his life. A prolific reader and a student of Anthropology, he is an eccentric character that writes articles about Linux and anything *nix.

Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox