Speedtest Tracker Docker Setup: Automated Internet Quality Monitoring for HomeLab

HomeLab tutorial - IT technology blog
HomeLab tutorial - IT technology blog

Comparing Approaches: Tracking ISP Performance in a HomeLab

When Zoom calls stutter or 4K streams buffer mid-movie, calling your ISP rarely helps without proof. First-line support agents will just ask you to power-cycle your modem. After five years of managing my own homelab cluster, I have evaluated three practical ways to log bandwidth and latency over time:

  • Manual Browser Benchmarks (Speedtest.net / Fast.com): Fine for quick spot checks. They tell you nothing about 2:00 AM bandwidth drops, subtle bufferbloat trends, or sporadic packet loss while you sleep.
  • DIY Cron Jobs (speedtest-cli + InfluxDB/Prometheus): Flexible if you already maintain an active monitoring stack. In practice, unofficial Python scrapers break whenever Ookla tweaks their API endpoints. Designing custom Grafana panels for non-technical housemates also burns hours of setup time.
  • Dedicated Speedtest Tracker Container: Bundles the official Ookla binary, an internal cron scheduler, webhook dispatchers (Telegram, Discord, Slack), and a clean web dashboard into one lightweight image.

Automating these checks cuts through the guesswork. Reliable upstream bandwidth underpins every externally facing homelab service, from Nextcloud file syncs to WireGuard tunnels. When that link degrades, everything slows down.

Pros & Cons of Self-Hosting Speedtest Tracker

Before scheduling round-the-clock speed runs, evaluate how continuous line saturation affects your local network.

The Advantages

  • Official Ookla CLI Engine: Modern builds run Ookla’s official C++ binary rather than community Python forks. This ensures accurate multi-thread throughput measurements on gigabit fiber lines.
  • Actionable Evidence for ISP Tickets: Export CSVs and timeline charts showing chronic evening slowdowns, peak ping spikes, and packet loss percentages across weeks or months.
  • Instant Alert Dispatching: Sends an alert within seconds if your download dips below 300 Mbps or ping exceeds 60 ms.
  • Set-and-Forget Architecture: Deploys once as an isolated service. It runs headlessly in the background without daily intervention.

The Drawbacks

  • Heavy Bandwidth Consumption: Testing a 1 Gbps symmetric link every 15 minutes transfers roughly 2.5 GB per run. That adds up to more than 7 TB of transfer every month, quickly blowing through residential data caps.
  • Intermittent Congestion: A saturation test hammers 100% of your pipe for 20 to 30 seconds. Anyone gaming or on a VoIP call during that window will notice an immediate latency spike.
  • Server Drift: Default auto-selection frequently picks random, congested peering nodes, skewing your historical benchmarks with false dips.

Recommended Setup Architecture

A few practical design choices keep tests reliable without exhausting hardware resources or monthly quotas:

  • Database Engine: Stick with SQLite for standalone instances. It limits container memory consumption to under 120MB while handling up to two years of hourly test records. Migrate to PostgreSQL only if you track a large multi-node fleet or retain sub-ten-minute telemetry indefinitely.
  • Testing Frequency: Schedule benchmarks every 60 to 120 minutes during normal operation. Drop down to 15-minute intervals only when actively diagnosing an open ISP support ticket.
  • Static Target Servers: Identify two or three high-capacity local servers from Ookla’s directory and lock their IDs directly into your environment file. Apples-to-apples comparisons require identical target destinations.
  • Hardwired Uplink: Run the container on a server connected via Cat6 directly into your core switch. Never benchmark WAN speeds across Wi-Fi. Local wireless channel contention and signal attenuation corrupt your external throughput data.

Implementation Guide: Deploying Speedtest Tracker on Docker

The original repository created by Alex Justesen transitioned maintenance to the LinuxServer.io team under lscr.io/linuxserver/speedtest-tracker. Here is a production-ready Compose template built on that maintained base.

Step 1: Directory Setup and Environment Preparation

Create a home for persistent application data on your Docker host and switch into it:

sudo mkdir -p /opt/speedtest-tracker/config
cd /opt/speedtest-tracker

Step 2: Create the Docker Compose File

Save this configuration as docker-compose.yml. It specifies an hourly schedule, allocates persistent storage, and configures an embedded SQLite database.

services:
  speedtest-tracker:
    image: lscr.io/linuxserver/speedtest-tracker:latest
    container_name: speedtest-tracker
    restart: unless-stopped
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=America/New_York
      - APP_KEY=
      - APP_URL=http://192.168.1.50:8080
      - DB_CONNECTION=sqlite
      - SPEEDTEST_SCHEDULE=0 * * * *
      - SPEEDTEST_SERVERS=1111,2222
      - PRUNE_RESULTS_OLDER_THAN=90
    volumes:
      - /opt/speedtest-tracker/config:/config
    ports:
      - 8080:80

Step 3: Generate the Encryption Key and Launch

Speedtest Tracker uses Laravel underneath, requiring an application encryption key to secure webhook URLs and stored tokens. Launch the initial container, generate the key string, and register it:

# Initialize the container to generate base directories
docker compose up -d

# Generate a unique application key
docker compose exec speedtest-tracker php artisan key:generate --show

Copy the terminal output (for instance, base64:3v...=) directly into APP_KEY= inside your docker-compose.yml. Then reload the container to apply changes:

docker compose up -d --force-recreate

Step 4: Finding Consistent Server IDs

Pinning static endpoints prevents auto-selection from choosing volatile transit routes. Query nearby Ookla nodes directly from the running container:

docker compose exec speedtest-tracker speedtest --servers

Inspect the output list for local data centers with low latency (under 15ms) and consistent line capacity. Pick two reliable IDs, insert them into SPEEDTEST_SERVERS separated by a comma (such as 18424,24215), and run docker compose up -d once more.

Step 5: Operational Best Practices

Once data starts flowing, keep these day-to-day pointers in mind:

  • Account for Data Caps: On a 1.2 TB Comcast or Cox data cap, running hourly gigabit tests consumes roughly 250 GB of data monthly. If quotas are tight, switch SPEEDTEST_SCHEDULE to 0 */4 * * * (every 4 hours) to cut bandwidth usage by 75%.
  • Back Up SQLite State: All historical measurements live in /opt/speedtest-tracker/config/database/database.sqlite. Include this single file in your nightly Borg or Restic backup routine to preserve long-term trend data.
  • Configure SLA Webhooks: Open http://<server-ip>:8080 in your browser and head to Settings > Notifications. Add your Discord or Telegram webhook, then set a threshold alarm to trigger whenever download rates plunge below 50% of your subscribed tier.
Share: