VPNSmith
self-host-vpnINFO

WireGuard on macOS: the two installs, and the interface name that breaks Linux tutorials

The App Store app and brew install wireguard-tools are not the same product. Which to pick, how to import a .conf, and why wg0 fails on macOS while utun works.

By Eric Gerard · Founder · VPNSmith - Self-host VPN & GDPR VPS specialist4 min readPhoto via Pixabay

Installing WireGuard on a Mac looks trivial until the tutorial you are following was written for Linux. Two things trip people up: there are two different WireGuard products for macOS, and the interface name everyone uses in examples, wg0, cannot exist on a Mac.

The two installs, from the official page

The WireGuard install page lists both, and they are genuinely different software:

The Mac App Store app. A graphical client with a menu-bar item, tunnel import, and on-demand activation. This is what most people want.

The command-line tools.

brew install wireguard-tools
# or, with MacPorts
port install wireguard-tools

This gives you wg and wg-quick, the same commands you use on a server. Under the hood it runs the userspace Go implementation rather than a kernel module, because macOS has no in-kernel WireGuard.

They do not share a tunnel list. A tunnel you import in the app will not appear in wg show, and vice versa. Choose one for a given machine unless you have a reason to run both.

Close-up of a terminal screen showing a Unix directory listing in green and blue
Close-up of a terminal screen showing a Unix directory listing in green and blue

The part that breaks Linux tutorials: wg0 does not exist here

This is the single most common failure, and the error message rarely explains it.

On Linux you create wg0 and move on. On macOS, tunnels ride the utun driver, and the WireGuard cross-platform documentation states the constraint plainly: the utun driver cannot have arbitrary interface names. You must use utun followed by a number, such as utun0, or plain utun to let the kernel choose one for you.

# fails on macOS
sudo wg-quick up wg0

# works
sudo wg-quick up utun

So if you copied a guide that says wg0, rename the config file and any command referencing it. The keys, AllowedIPs, Endpoint and DNS lines are unaffected: only the interface name is platform-specific.

Finding out which utun you got. If you let the kernel pick, you need a way to know the result. Set WG_TUN_NAME_FILE before bringing the tunnel up and the chosen name is written there:

export WG_TUN_NAME_FILE=/tmp/wg-name
sudo -E wg-quick up utun
cat /tmp/wg-name    # e.g. utun4

Without that, you are reading ifconfig output and guessing which utun belongs to you, which is fine once and tedious in a script.

Importing a config you already have

If you generated a client config on your server, it transfers as-is. In the App Store app, use the import option and select the .conf file; the tunnel appears in the list, ready to toggle. With the CLI, place it at /opt/homebrew/etc/wireguard/utun.conf (Apple Silicon) or /usr/local/etc/wireguard/utun.conf (Intel), naming the file after the interface, then run wg-quick up utun.

A config generated for a phone works on a Mac too. It is a peer definition, not a device-specific artefact, provided each device has its own key pair rather than a shared one.

Checking it actually works

Bring the tunnel up, then confirm two things rather than assuming.

sudo wg show

A healthy peer shows a latest handshake within the last two minutes and non-zero transfer in both directions. Sent-but-not-received is the signature of a blocked return path. If the handshake never completes, our handshake troubleshooting guide walks the causes in order of likelihood.

Then confirm the traffic is really going through the tunnel, not just that the interface exists: check your public IP from the browser, and if you route DNS through the tunnel, verify there is no leak. Our note on WireGuard DNS leak prevention covers the settings that matter.

The short version

Two products: the App Store app for a graphical client, wireguard-tools via Homebrew or MacPorts for the same CLI as your server. They do not share tunnels. And on macOS the interface must be named utun or utunN, never wg0, because the utun driver does not accept arbitrary names. That single line explains most failed Mac setups copied from Linux guides.

★ Nuremberg GDPR datacenter · ✓ Dedicated IPv4 included · 200+ Mbps guaranteed

Your Mac is the client. The tunnel needs a server → Contabo VPSA Linux VPS runs the WireGuard side your Mac connects to, with a kernel implementation rather than userspace. Root access, predictable pricing, EU datacenters.

★ Nuremberg GDPR datacenter · ✓ Dedicated IPv4 included · 200+ Mbps guaranteed

Self-host your VPN on your own VPS → ContaboFull root access · public IPv4 · pick your region

Frequently asked questions

How do I install WireGuard on macOS?
The official install page lists two routes. The graphical app comes from the Mac App Store. The command-line tools come from a package manager: `brew install wireguard-tools` with Homebrew, or `port install wireguard-tools` with MacPorts. They are not the same product and they do not share a tunnel list, so pick one and stay with it unless you specifically want both.
Why does wg0 not work on macOS?
Because macOS has no kernel WireGuard module, so tunnels run through the userspace implementation on the utun driver, and that driver does not accept arbitrary interface names. The WireGuard cross-platform documentation is explicit: you must use utun followed by a number, or plain utun to let the kernel pick one. A Linux tutorial telling you to create wg0 will therefore fail on a Mac, and the error rarely says why.
How do I know which utun interface the kernel chose?
Set the WG_TUN_NAME_FILE environment variable before bringing the tunnel up. When the interface name is left as utun, the name actually selected by the kernel is written to the file you named. Without it you are left reading `ifconfig` output and guessing which utun belongs to your tunnel.
App Store app or Homebrew tools: which should I use?
Use the App Store app if you want a normal macOS experience: a menu-bar toggle, tunnel import by drag-and-drop, and on-demand activation. Use wireguard-tools if you script things, manage the machine over SSH, or want the same wg and wg-quick commands you already use on your server. The app is sandboxed and updates through the App Store; the CLI updates through your package manager.
Can I reuse the .conf file from my Linux server?
Yes for the client side. A peer configuration is plain text and portable, so the [Interface] and [Peer] blocks you generated for a laptop work as-is. The one thing that does not transfer is the interface name: rename it to utun or utunN if the file or your commands reference wg0. Keys, AllowedIPs, Endpoint and DNS all carry over unchanged.