FreeGuard for Linux: Command-Line VPN with Rules and GeoIP Routing
FreeGuard for Linux is a command-line client for servers and developers: custom routing rules, GeoIP region routing, JSON output and a systemd user service. Install it with one command on x86_64 or arm64.
FreeGuard for Linux is a command-line client built for servers and developers: route traffic with your own rules or by region with GeoIP, script it with JSON output and run it as a systemd user service. Install it with one command on x86_64 or arm64.
FreeGuard on Linux Is a Command-Line Client
A single Go binary that sets up the mihomo core for you. For a graphical app, use FreeGuard for Windows or Mac.
The freeguard CLI handles sign-in, server selection, connection, routing rules and autostart from the terminal. It is a single Go binary for x86_64 and arm64 Linux that sets up the mihomo core for you, so it fits servers, containers and minimal installs as well as developer laptops.
There is no Linux desktop app. If you want a graphical interface, use the FreeGuard Windows or Mac app.
Route Traffic Your Way: Rules and GeoIP Region Routing
Write your own routing rules or send one region’s traffic direct, then check the routing summary after you connect.
- Rule mode by default: routing rules decide which traffic goes through the VPN and which goes direct, and
freeguard connectprints a plain-language routing summary - Custom rules:
freeguard rule add DOMAIN example.com DIRECTadds a rule;rule list,rule removeandrule import(from a URL or a file) manage the rest - GeoIP region routing:
freeguard config set geoip_region CNsends one region’s traffic, such as CN or JP, direct while everything else stays on the VPN - TUN mode:
freeguard connect --tuncaptures all of the machine’s traffic; without it, FreeGuard serves a local proxy that your apps can use
Install FreeGuard on Linux
Three supported install paths: our install script, Homebrew, or GitHub Releases. There are no official apt, dnf or pacman repositories.
Install script (recommended):
curl -fsSL https://downloadcli.freeguardvpn.com/cli/install.sh | sh
Install with Homebrew:
brew install planetlinkinc/tap/freeguardvpn
Direct binary: download the release for your architecture from GitHub Releases.
We do not publish .deb, .rpm or Arch packages through distribution repositories, so there is no apt install freeguard, dnf install freeguard or pacman -S freeguard.
More CLI Features
- Protocols: anytls, hysteria2 and trojan; pick one per connection, for example
freeguard connect la2 anytls - Server selection:
freeguard connect la2orhk1by alias,freeguard connect USfor the best US server, or plainfreeguard connectto reuse your last server or pick the best one - Autostart:
freeguard autostart enableinstalls a systemd user service at~/.config/systemd/user/freeguard.service(no root daemon required) - Diagnostics:
freeguard doctorchecks your environment - Status and monitoring:
freeguard statusandfreeguard monitorshow live connection details - Scripting: add
--jsonto a command for output that scripts and AI agents can read
How to Get Started
- Step 1: Run
curl -fsSL https://downloadcli.freeguardvpn.com/cli/install.sh | sh - Step 2: Run
freeguard initand sign in with your FreeGuard account - Step 3: Run
freeguard connect(orfreeguard connect la2for a specific server)
Frequently Asked Questions
Does FreeGuard have a Linux GUI application?
No. FreeGuard for Linux is the freeguard command-line client. If you want a graphical interface, use the Windows or Mac app.
How do I route only some traffic through the VPN on Linux?
Use routing rules or GeoIP region routing. freeguard rule add sends specific domains or IP ranges direct or through the VPN, and freeguard config set geoip_region CN sends one region’s traffic direct while the rest stays on the VPN.
Is the Linux CLI free?
Installing it is free. Connecting uses your FreeGuard subscription; run freeguard subscribe list to see the plans.
Can I install FreeGuard from my distribution’s package manager?
Not from official distribution repositories. Use our install script (install.sh), Homebrew, or a binary from GitHub Releases. We do not publish to apt, dnf, pacman or the AUR.
Does the CLI work on headless servers and Docker?
Yes. The CLI is a single Go binary with no GUI dependencies. It runs over SSH, inside containers and on minimal base images, as long as a container has the network capabilities it needs to create a TUN device.
Can I start FreeGuard automatically at boot?
Yes. freeguard autostart enable installs a systemd user service at ~/.config/systemd/user/freeguard.service. It runs as your user, not as a root daemon.
Which architectures and distributions are supported?
x86_64 and arm64 Linux. The CLI is a single Go binary that sets up the mihomo core for you, so any modern distribution with a recent kernel should work; we test mainly on Ubuntu and Debian.
Does the Linux CLI use the same protocols as the desktop apps?
Yes. anytls, hysteria2 and trojan all work in the CLI, on the same mihomo core that the Windows and Mac apps use.
How do I uninstall the CLI?
If you used the install script, remove the freeguard binary from /usr/local/bin (or ~/.local/bin) and delete ~/.freeguard. With Homebrew, run brew uninstall freeguardvpn. If you enabled autostart, run freeguard autostart disable first.
FreeGuard respects all applicable laws. Users are responsible for ensuring their use of VPN services complies with local laws and the terms of service of third-party platforms. FreeGuard does not encourage or endorse any activity that violates applicable laws or terms of service.