Why Test Internet Speed on a Raspberry Pi?
A Raspberry Pi is a small, cheap computer about the size of a credit card. It's perfect for running background tasks — and one of the most popular uses is monitoring your internet speed around the clock. Instead of manually checking your connection, a Pi can test it every hour and log the results automatically.
Whether you want to hold your ISP accountable, track network performance over time, or just geek out with a fun project, testing speed on a Raspberry Pi is surprisingly easy. Let's walk through how to do it, what tools to use, and what kind of results to expect.
What You Need to Get Started
Hardware
You don't need the latest and greatest Pi for speed testing. Here's what works:
- Raspberry Pi 3B+ or newer — the 3B+ has gigabit Ethernet (capped around 300 Mbps due to USB 2.0 bus limitations).
- Raspberry Pi 4 or Pi 5 — true gigabit Ethernet, so you can test speeds up to 940 Mbps.
- A microSD card (16 GB or larger) with Raspberry Pi OS installed.
- An Ethernet cable for the most accurate results. Wi-Fi adds too many variables.
- A power supply appropriate for your Pi model.
Software
You'll need a command-line speed test tool. The two most popular options are:
- Speedtest CLI by Ookla — the official command-line version of the well-known speed test.
- speedtest-cli (Python-based) — an open-source alternative. It's older and sometimes less accurate at high speeds.
For quick browser-based tests, you can also open Chromium on your Pi and run a speed test directly from Speedtest.now. This is the fastest way to get a one-off reading without installing anything.
Step-by-Step Setup Guide
Installing the Speedtest CLI
Open a terminal on your Raspberry Pi and run these commands to install the official Speedtest CLI:
- Update your package list:
sudo apt update - Install required packages:
sudo apt install curl apt-transport-https gnupg - Add the Ookla repository key and source list (check Ookla's website for the current commands for your OS version).
- Install the tool:
sudo apt install speedtest - Run your first test:
speedtest
The first time you run it, you'll need to accept the license. After that, each test takes about 15–30 seconds and gives you download speed, upload speed, ping, and the server used.
Automating Tests with Cron
The real power of a Raspberry Pi setup is automation. You can use cron, a built-in scheduler, to run tests at set intervals and save the results to a file.
Open your crontab with crontab -e and add a line like this:
0 * * * * speedtest --format=csv >> /home/pi/speedlog.csv
This runs a test every hour on the hour and appends the results as a CSV row. After a week, you'll have 168 data points — enough to spot patterns like slowdowns during peak evening hours (typically 7 PM to 11 PM).
Visualizing Your Data
A CSV file full of numbers isn't very exciting. Many people pair their Pi speed logger with tools like Grafana and InfluxDB to create live dashboards. You can see charts of your download speed, upload speed, and latency over days, weeks, or months. There are plenty of open-source projects on GitHub that bundle all of this together.
What Speeds to Expect on Each Pi Model
Your Raspberry Pi model matters a lot. The network hardware inside the Pi sets a hard ceiling on the speeds you can measure. Here's how each model stacks up:
| Raspberry Pi Model | Ethernet Port | Max Practical Speed | Good For |
|---|---|---|---|
| Pi 3B | 100 Mbps | ~95 Mbps | Plans up to 100 Mbps |
| Pi 3B+ | Gigabit (via USB 2.0) | ~300 Mbps | Plans up to 300 Mbps |
| Pi 4B | True Gigabit | ~940 Mbps | Plans up to 1 Gbps |
| Pi 5 | True Gigabit | ~940 Mbps | Plans up to 1 Gbps |
| Pi Zero 2 W | Wi-Fi only | ~30–50 Mbps | Wi-Fi monitoring only |
If you're on a plan faster than 300 Mbps, don't use a Pi 3B+ and then wonder why your speed is lower than your plan. The hardware simply can't keep up. A Pi 4 or Pi 5 is the right choice for gigabit connections.
Tips for Getting Accurate Results
Always Use Ethernet
Wi-Fi on a Raspberry Pi is notoriously inconsistent. The built-in Wi-Fi antenna is tiny and easily affected by distance, walls, and interference. For speed testing, always plug in an Ethernet cable directly to your router. If you're curious about your Wi-Fi performance separately, check out our guide on how to improve Wi-Fi speed.
Don't Run Other Tasks During Tests
A Raspberry Pi has limited CPU power and RAM compared to a desktop. If you're running a Plex server, Pi-hole, or a torrent client at the same time, those tasks will eat into your bandwidth and processing power. Your speed results will be lower than your actual connection. Close other services or schedule tests during quiet periods.
Pick the Right Server
Most speed test tools auto-select the nearest server, but sometimes they pick poorly. If you get strange results, try manually choosing a server that's geographically close to you — ideally within 100 miles. Server choice can easily swing your ping by 20–50 ms and your download speed by 10–15%. You can learn more about what makes a good connection in our latency explainer.
Test Multiple Times
A single speed test is just a snapshot. Internet speeds fluctuate throughout the day. Run at least 3–5 tests before drawing conclusions, or better yet, let your cron job collect data over a full week. Look at averages and minimums, not just the peak number.
Going Beyond Simple Speed Tests
Download and upload speed are just part of the picture. Your Raspberry Pi can also monitor:
- Ping — how long it takes a tiny packet of data to make a round trip to a server. Under 20 ms is great. You can test your ping here.
- Jitter — the variation in ping over time. High jitter (above 5 ms) causes choppy video calls and lag in games. Check your jitter to see where you stand.
- Packet loss — when data packets never arrive. Even 1% packet loss can make your connection feel terrible. Use our packet loss test to measure it.
You can set up scripts on your Pi to ping a server every minute and log the results. Over time, this gives you hard evidence if your ISP is delivering inconsistent service — especially useful when you need to call their support line.
Wrapping Up
A Raspberry Pi makes an excellent always-on internet speed monitor. Use a Pi 4 or Pi 5 with Ethernet for the best accuracy, install the Speedtest CLI, and set up a cron job to log results hourly. After a week of data, you'll have a clear picture of your real-world internet performance — not just the number your ISP promised.
If you want a quick one-time check right now, just run a speed test from any browser. But for ongoing monitoring, nothing beats a dedicated Pi quietly logging every test in the background. It's a $35–75 investment that pays for itself the first time you catch your ISP underdelivering.