How to Run a pfSense Speed Test

  • Post author:Frank Joseph
  • Post published:
  • Post last modified:
  • Post category:pfSense
  • Reading time:7 mins read

To run a pfSense speed test, open Diagnostics > Command Prompt, search for the speedtest-cli package with pkg search speedtest, install the speedtest-cli package it lists, then run speedtest-cli --secure. The test runs on the pfSense router itself, so you don’t need a PC plugged into your modem. The steps below are current for pfSense CE 2.8.1 and 2.9.0 as of October 2026.

Running a speedtest from pfSense puts the test as close to your modem as you can get without unplugging anything, since a test on a PC or phone also goes through a switch or access point. A PC test isn’t wrong, it just has more between it and the modem.

How to Run a Speed Test on pfSense

1. Select Diagnostics, then Command Prompt.

The pfSense Diagnostics menu open, with Command Prompt listed under ARP Table, Authentication and Backup & Restore

2. In the Execute Shell Command section, enter the command below and select Execute.

pkg search speedtest

I suggest running the search first because the package gets updated, and a command copied from an older guide can error out once it does. That’s what happened to the original version of this tutorial. When I recorded the video for it on pfSense 2.5.2 in 2022, the search returned py38-speedtest-cli-2.1.3, and while the version is still 2.1.3, no current pfSense CE repo has a py38 package. On CE 2.7.2, 2.8.1 and 2.9.0, the package is py311-speedtest-cli instead, and 2.8.1 and 2.9.0 also list speedtest-go, a different client, so install the speedtest-cli line.

On pfSense Plus, install whatever speedtest-cli name your own search returns. CE 2.7.2 is no longer supported, so if you’re still on it, updating pfSense using best practices is worth doing first.

Shell Output of pkg search speedtest on pfSense 2.5.2, listing py38-speedtest-cli-2.1.3
From pfSense 2.5.2 in 2022, when the search returned py38-speedtest-cli.

3. Run the command below to install the pfSense speedtest client, swapping in the speedtest-cli name your search returned if it’s different.

pkg install -y py311-speedtest-cli

You don’t need the version number at the end, since pkg installs whatever version the repo carries and the command won’t break when the revision changes (2.9.0 already carries 2.1.3_1).

Shell Output of pkg install -y py38-speedtest-cli-2.1.3 installing the package on pfSense 2.5.2
The 2022 install on pfSense 2.5.2.

4. Run the speed test with the command below. Command Prompt only shows the output once the test finishes, so give it a little while.

speedtest-cli --secure

If speedtest-cli comes back with command not found, the package never installed. Search again and install the speedtest-cli name it lists.

5. The results are shown in the Shell Output section.

speedtest-cli results in the pfSense Shell Output section, showing the selected server, download speed and upload speed
From pfSense 2.5.2 in 2022, run without –secure.

Running the Speed Test Over SSH

Over SSH you see the output as it runs instead of all at once. SSH is off by default. Enable it under System > Advanced, on the Admin Access tab, by checking Enable Secure Shell and selecting Save (more on enabling SSH on pfSense). Over SSH (logged in as admin) or at the console, pick option 8) Shell from the menu, and the same commands work. SSH is one more way into your firewall, so if you only turned it on for this, turn it back off afterward, and as with anything security-related, things change and nothing here is guaranteed.

Why Your Result Might Be Lower Than Your Plan

If your switch, access points and everything else are in use while you test, some of your bandwidth is going to those devices, so you won’t get the exact result you’d see with nothing but the router plugged into your modem.

The router plays a part too. Netgate notes that traffic starting or ending on the firewall performs differently from traffic passing through it, so a test run on pfSense can read lower than one from a PC behind it, and that isn’t necessarily your ISP. If you suspect the box is the bottleneck, the best pfSense hardware is a good place to start. For everything else, Netgate’s Troubleshooting Low Interface Throughput page covers duplex, traffic shaping and MTU, and its last step is testing the modem without the firewall.

Customizing the pfSense speedtest-cli Command

Running speedtest-cli on its own picks a server automatically, and you might notice it isn’t the closest one, which is generally the one you want. Run the command below to see every option (the output after it is from 2.1.3, which is still the latest release).

speedtest-cli -h
usage: speedtest-cli [-h] [--no-download] [--no-upload] [--single] [--bytes]
                     [--share] [--simple] [--csv]
                     [--csv-delimiter CSV_DELIMITER] [--csv-header] [--json]
                     [--list] [--server SERVER] [--exclude EXCLUDE]
                     [--mini MINI] [--source SOURCE] [--timeout TIMEOUT]
                     [--secure] [--no-pre-allocate] [--version]
Command line interface for testing internet bandwidth using speedtest.net.
--------------------------------------------------------------------------
https://github.com/sivel/speedtest-cli
options:
  -h, --help            show this help message and exit
  --no-download         Do not perform download test
  --no-upload           Do not perform upload test
  --single              Only use a single connection instead of multiple. This
                        simulates a typical file transfer.
  --bytes               Display values in bytes instead of bits. Does not
                        affect the image generated by --share, nor output from
                        --json or --csv
  --share               Generate and provide a URL to the speedtest.net share
                        results image, not displayed with --csv
  --simple              Suppress verbose output, only show basic information
  --csv                 Suppress verbose output, only show basic information
                        in CSV format. Speeds listed in bit/s and not affected
                        by --bytes
  --csv-delimiter CSV_DELIMITER
                        Single character delimiter to use in CSV output.
                        Default ","
  --csv-header          Print CSV headers
  --json                Suppress verbose output, only show basic information
                        in JSON format. Speeds listed in bit/s and not
                        affected by --bytes
  --list                Display a list of speedtest.net servers sorted by
                        distance
  --server SERVER       Specify a server ID to test against. Can be supplied
                        multiple times
  --exclude EXCLUDE     Exclude a server from selection. Can be supplied
                        multiple times
  --mini MINI           URL of the Speedtest Mini server
  --source SOURCE       Source IP address to bind to
  --timeout TIMEOUT     HTTP timeout in seconds. Default 10
  --secure              Use HTTPS instead of HTTP when communicating with
                        speedtest.net operated servers
  --no-pre-allocate     Do not pre allocate upload data. Pre allocation is
                        enabled by default to improve upload performance. To
                        support systems with insufficient memory, use this
                        option to avoid a MemoryError
  --version             Show the version number and exit

To test against the closest server, run the command below to see servers sorted by distance with their IDs.

speedtest-cli --secure --list

Then run the test with the ID you want in place of SERVER_ID. Adding --simple cuts the output down to ping, download and upload.

speedtest-cli --secure --server SERVER_ID

If You Get HTTP Error 403: Forbidden

speedtest-cli talks to speedtest.net over plain HTTP by default, and since 2023 people have reported ERROR: HTTP Error 403: Forbidden on that run, which the --secure flag (HTTPS) fixes. --secure doesn’t hurt anything even when the default run works, which is why every command above uses it.

Please note that sivel/speedtest-cli, the project behind it, was archived on April 30, 2026. pfSense still packages it, but if speedtest.net changes something that breaks it, there won’t be a fix.

Other Ways to Test Speed on pfSense

A speed test measures your internet connection. For LAN throughput, the iperf package (iperf3 under the hood) adds Diagnostics > iperf with Client and Server tabs. Netgate says iperf running on pfSense “is NOT a suitable way of testing firewall throughput”, though, so it’s best for something like a wireless link to the firewall. The iperf3 commands are the same anywhere, and I’ve shown how they work in running a speed test with iPerf3 on a Synology NAS.

Ookla’s official Speedtest CLI isn’t in pfSense’s repo. Getting it means adding FreeBSD’s repo, which Netgate does not support, and it conflicts with speedtest-cli, so there’s no install command for it here. There’s no official dashboard widget either, and the one on GitHub is an unofficial community project.

Frank Joseph

I'm Frank, founder of WunderTech. I've been working in enterprise IT for 15+ years and running home labs for nearly a decade — every tutorial on this site is tested on hardware I actually own, including Synology NAS units, a DIY TrueNAS server, a Proxmox cluster, a full UniFi network, and more. I hold a BS in Computer Information Systems and an MBA, but most of what you'll read here comes from my home lab, not a classroom. You can also find video versions of these tutorials on my YouTube channel.