How to Run an iPerf3 Server (Phone, Mac, NAS, Router)

How to run an iPerf3 server on a phone, Mac, NAS, or router so another device can measure throughput to it, plus the port and firewall basics.

iPerf3 Client & Server running in server mode on iPhone, listening for a client
Server mode turns the device into the listening endpoint for any compatible iperf3 client on the LAN.

Every iPerf3 test has two halves. One device sends traffic — the client — and one device receives it and reports the numbers — the server. Most guides assume the server already exists somewhere. It usually doesn’t. The single most common reason a first iPerf3 test fails is “connection refused”: there was nothing listening on the other end. This post is the other end. It covers how to stand up an iPerf3 server on whatever hardware you have — a phone, a Mac or PC, a NAS, or a router — so a client has something to talk to.

The short answer

An iPerf3 server is just iperf3 in listening mode, waiting for a client to connect. To run one, either open the iPerf3 Client & Server app, switch to Server mode, and tap Start, or on a computer run iperf3 -s in a terminal. It listens on TCP port 5201 by default and does nothing until a client points at its local IP address. Note that IP and the port, make sure a firewall isn’t blocking 5201, and you have a target for any client on the same network.

What an iPerf3 server actually is

There’s no separate “server program.” iperf3 is one binary that runs as either role depending on a flag: -s for server, -c for client. The server side opens a listening socket on a port (5201 unless you change it) and waits. When a client connects, the two negotiate the test, push traffic for the requested duration, and the server reports what it received. Then it goes back to waiting.

That means a “server” can be anything that runs iperf3: a spare phone on the shelf, the Mac on your desk, a NAS in the closet, a Raspberry Pi, a router with the right firmware. You pick whichever device sits at the point in the network you want to measure to.

Option 1: A server on a phone or tablet

This is the option the command line can’t give you easily, and it’s why a native app is useful. You can turn the phone in your pocket into an iPerf3 server in about ten seconds, no terminal, no SSH.

  1. Open iPerf3 Client & Server and switch to Server mode.
  2. Leave the port at 5201.
  3. Tap Start. The app shows it’s listening.
  4. Read the device’s local IP from the app or from Settings → Wi-Fi → (i). It looks like 192.168.1.50.

Now any client on the same network can test against this phone. This is genuinely handy: make the phone the server, put a laptop on Ethernet as the client, and you’ve measured the Wi-Fi link to exactly where the phone is sitting — a corner, a far room, a patio.

iPerf3 Client & Server iPhone server mode showing local IP and listening state
A phone can be the server endpoint when you need to measure toward a specific room, desk, or client site.

Keep the screen awake

A phone or tablet acting as the server needs to stay awake and on the network for the duration. Plug it in and keep the app in the foreground while a test runs; if the device sleeps, the listening socket drops and the client gets “connection refused.”

Option 2: A server on a Mac or PC

Two ways, pick whichever you prefer.

With the app (macOS): open iPerf3 Client & Server, switch to Server mode, Start. Same as the phone, but on a machine that’s usually wired — which makes it the cleanest possible server, because Ethernet removes the wireless variance on the server side.

With the command line: if iperf3 is installed (brew install iperf3 on macOS, your package manager on Linux, the official build on Windows), just run:

iperf3 -s

It prints Server listening on 5201 and waits. Add -p 5202 to listen on a different port, or -D to run it as a background daemon on Linux.

Either way, find the machine’s local IP (ipconfig getifaddr en0 on macOS, ip addr on Linux, ipconfig on Windows) and give that to the client.

iPerf3 for Mac server mode listening on port 5201
Mac server mode is the clean default when the machine is wired to Ethernet.
iPerf3 for Android server mode running with local IP and live metrics
Android server mode covers the same workflow when the endpoint is a phone.

Option 3: A server on a NAS, router, or homelab box

The most useful servers are the always-on devices you already have:

  • NAS (Synology, TrueNAS, etc.): most can run iperf3 from a package or a container. A server here lets you measure the real throughput to your storage, which is what actually matters for backups and media.
  • Router/firewall (OpenWrt, pfSense, OPNsense): many can run iperf3 directly, which lets you isolate the wired path to the gateway from the Wi-Fi.
  • Raspberry Pi or any Linux box: sudo apt install iperf3 then iperf3 -s. A Pi taped to a wall makes a permanent test endpoint.
  • Docker: docker run -it --rm -p 5201:5201 networkstatic/iperf3 -s stands up a throwaway server in seconds.

Leave one of these running permanently and you always have something to test against from any device.

The two things that go wrong

Almost every failed server comes down to one of these:

  1. Firewall blocking the port. The server is listening, but the host’s firewall drops incoming 5201. On macOS, allow the app/iperf3 in System Settings → Network → Firewall. On Linux, sudo ufw allow 5201. On a NAS or router, open 5201 (TCP, and UDP too if you’ll test UDP) on the LAN side.
  2. Wrong IP or different subnet. The client must reach the server’s local IP, and both must be on the same network. A 192.168.1.x client can’t reach a 192.168.4.x server without routing between the VLANs. Don’t use the public IP, and don’t use 127.0.0.1 — that only works on the same machine.

Confirm it works

From the client, run a normal test against the server’s IP and port. If you get numbers, you’re done. If you get “connection refused,” the server isn’t listening or a firewall is in the way. If it just hangs, you’re probably on a different subnet or the IP is wrong.

Why server mode in a pocket matters

Plenty of iPerf3 tools are client-only — they can connect to a server but can’t be one. That forces you to always have a “real” server somewhere. Being able to flip either device into server mode removes that constraint:

  • Test to a specific room by putting the server-phone there.
  • Test between two phones with no computer involved at all.
  • Carry your test endpoint with you to a client site, a friend’s house, or a lab.
  • Save each result and export it, so a quick server-and-client check becomes a documented before/after.

The wire protocol is the standard iperf3, so a phone acting as the server is fully interoperable with the iperf3 binary on a laptop, a NAS, or a homelab dashboard.

Bottom line

A server isn’t a separate piece of software or a cloud service — it’s just iperf3 listening on one device while another connects to it. Put it on the device that sits where you want to measure, note the IP and port, clear the firewall, and you’ve got a permanent target for any throughput test on your network.