docker.recipes

Speedtest Tracker with InfluxDB

beginner

Automated internet speed testing with tracking.

Overview

Speedtest Tracker is a self-hosted Laravel application that automatically runs internet speed tests using the official Speedtest CLI and stores the results for historical analysis. Originally created to address the need for consistent, automated monitoring of internet connection quality, it provides a clean web interface for viewing speed test results and trends over time. The application eliminates the need to manually run speed tests and provides concrete data when dealing with ISP performance issues or network troubleshooting. This monitoring stack combines Speedtest Tracker's automated testing capabilities with InfluxDB's time-series database optimized for storing timestamped speed test metrics, and Grafana's powerful visualization platform for creating detailed network performance dashboards. InfluxDB's high-performance time-series storage handles the continuous flow of speed test data efficiently, while Grafana transforms raw metrics into actionable insights through customizable charts, alerts, and trend analysis. The integration allows for sophisticated monitoring that goes beyond simple pass/fail metrics to track performance patterns, identify peak usage impacts, and correlate speed degradation with specific time periods. Homelab enthusiasts, remote workers, and small businesses who depend on reliable internet connectivity will find this stack invaluable for documenting network performance and holding ISPs accountable for service level agreements. The combination is particularly useful for users who experience intermittent connectivity issues that are difficult to reproduce when contacting support, as it provides historical evidence of performance problems with precise timestamps and measurements.

Key Features

  • Automated speed testing every 4 hours using official Speedtest CLI with customizable cron scheduling
  • InfluxDB 2.0 time-series storage with built-in data retention policies for managing long-term speed test history
  • Grafana dashboard creation with pre-built speedtest visualization templates and alerting capabilities
  • Speedtest Tracker web interface showing download/upload speeds, ping latency, and ISP information
  • InfluxDB Flux query language support for advanced analytics like percentile calculations and moving averages
  • Grafana's 50+ data source integration allowing correlation with other network monitoring tools
  • Historical trend analysis with InfluxDB's continuous queries for automatic data aggregation
  • Multi-server speedtest support in Speedtest Tracker for testing against different geographic locations

Common Use Cases

  • 1Home office workers documenting internet performance for employer reimbursement or upgrade justification
  • 2Small businesses monitoring SLA compliance and collecting evidence for ISP service disputes
  • 3Homelab administrators tracking network performance impact when adding new services or users
  • 4Remote workers correlating video call quality issues with specific bandwidth degradation periods
  • 5Network administrators comparing performance across multiple ISPs or connection types
  • 6Content creators monitoring upload speeds for streaming and video upload scheduling optimization
  • 7Troubleshooting intermittent connectivity issues by identifying patterns in speed degradation over time

Prerequisites

  • Minimum 1.5GB RAM for InfluxDB (1GB) and Grafana (512MB) with additional overhead for Speedtest Tracker
  • Available ports 3000 (Grafana), 8080 (Speedtest Tracker), and 8086 (InfluxDB) or alternative port configuration
  • Docker host with stable internet connection capable of running automated speed tests without interference
  • Environment variables configured: INFLUX_USER, INFLUX_PASSWORD, and GRAFANA_PASSWORD for service authentication
  • Understanding of InfluxDB bucket and organization concepts for configuring data export from Speedtest Tracker
  • Basic Grafana dashboard creation knowledge for building custom speedtest visualizations beyond default views

For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms

docker-compose.yml

docker-compose.yml
1services:
2 speedtest-tracker:
3 image: ghcr.io/alexjustesen/speedtest-tracker:latest
4 container_name: speedtest-tracker
5 restart: unless-stopped
6 ports:
7 - "${SPEEDTEST_PORT:-8080}:80"
8 environment:
9 - PUID=1000
10 - PGID=1000
11 - DB_CONNECTION=sqlite
12 - SPEEDTEST_SCHEDULE=0 */4 * * *
13 volumes:
14 - speedtest_config:/config
15
16 influxdb:
17 image: influxdb:2
18 container_name: speedtest-influxdb
19 restart: unless-stopped
20 ports:
21 - "${INFLUX_PORT:-8086}:8086"
22 environment:
23 - DOCKER_INFLUXDB_INIT_MODE=setup
24 - DOCKER_INFLUXDB_INIT_USERNAME=${INFLUX_USER}
25 - DOCKER_INFLUXDB_INIT_PASSWORD=${INFLUX_PASSWORD}
26 - DOCKER_INFLUXDB_INIT_ORG=homelab
27 - DOCKER_INFLUXDB_INIT_BUCKET=speedtest
28 volumes:
29 - influxdb_data:/var/lib/influxdb2
30
31 grafana:
32 image: grafana/grafana:latest
33 container_name: speedtest-grafana
34 restart: unless-stopped
35 ports:
36 - "${GRAFANA_PORT:-3000}:3000"
37 environment:
38 - GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD}
39 volumes:
40 - grafana_data:/var/lib/grafana
41
42volumes:
43 speedtest_config:
44 influxdb_data:
45 grafana_data:

.env Template

.env
1# Speedtest Tracker
2SPEEDTEST_PORT=8080
3INFLUX_PORT=8086
4INFLUX_USER=admin
5INFLUX_PASSWORD=influx_password
6GRAFANA_PORT=3000
7GRAFANA_PASSWORD=admin

Usage Notes

  1. 1Speedtest at http://localhost:8080
  2. 2Grafana at http://localhost:3000
  3. 3Tests run every 4 hours
  4. 4Export to InfluxDB in settings

Individual Services(3 services)

Copy individual services to mix and match with your existing compose files.

speedtest-tracker
speedtest-tracker:
  image: ghcr.io/alexjustesen/speedtest-tracker:latest
  container_name: speedtest-tracker
  restart: unless-stopped
  ports:
    - ${SPEEDTEST_PORT:-8080}:80
  environment:
    - PUID=1000
    - PGID=1000
    - DB_CONNECTION=sqlite
    - SPEEDTEST_SCHEDULE=0 */4 * * *
  volumes:
    - speedtest_config:/config
influxdb
influxdb:
  image: influxdb:2
  container_name: speedtest-influxdb
  restart: unless-stopped
  ports:
    - ${INFLUX_PORT:-8086}:8086
  environment:
    - DOCKER_INFLUXDB_INIT_MODE=setup
    - DOCKER_INFLUXDB_INIT_USERNAME=${INFLUX_USER}
    - DOCKER_INFLUXDB_INIT_PASSWORD=${INFLUX_PASSWORD}
    - DOCKER_INFLUXDB_INIT_ORG=homelab
    - DOCKER_INFLUXDB_INIT_BUCKET=speedtest
  volumes:
    - influxdb_data:/var/lib/influxdb2
grafana
grafana:
  image: grafana/grafana:latest
  container_name: speedtest-grafana
  restart: unless-stopped
  ports:
    - ${GRAFANA_PORT:-3000}:3000
  environment:
    - GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD}
  volumes:
    - grafana_data:/var/lib/grafana

Quick Start

terminal
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 speedtest-tracker:
5 image: ghcr.io/alexjustesen/speedtest-tracker:latest
6 container_name: speedtest-tracker
7 restart: unless-stopped
8 ports:
9 - "${SPEEDTEST_PORT:-8080}:80"
10 environment:
11 - PUID=1000
12 - PGID=1000
13 - DB_CONNECTION=sqlite
14 - SPEEDTEST_SCHEDULE=0 */4 * * *
15 volumes:
16 - speedtest_config:/config
17
18 influxdb:
19 image: influxdb:2
20 container_name: speedtest-influxdb
21 restart: unless-stopped
22 ports:
23 - "${INFLUX_PORT:-8086}:8086"
24 environment:
25 - DOCKER_INFLUXDB_INIT_MODE=setup
26 - DOCKER_INFLUXDB_INIT_USERNAME=${INFLUX_USER}
27 - DOCKER_INFLUXDB_INIT_PASSWORD=${INFLUX_PASSWORD}
28 - DOCKER_INFLUXDB_INIT_ORG=homelab
29 - DOCKER_INFLUXDB_INIT_BUCKET=speedtest
30 volumes:
31 - influxdb_data:/var/lib/influxdb2
32
33 grafana:
34 image: grafana/grafana:latest
35 container_name: speedtest-grafana
36 restart: unless-stopped
37 ports:
38 - "${GRAFANA_PORT:-3000}:3000"
39 environment:
40 - GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD}
41 volumes:
42 - grafana_data:/var/lib/grafana
43
44volumes:
45 speedtest_config:
46 influxdb_data:
47 grafana_data:
48EOF
49
50# 2. Create the .env file
51cat > .env << 'EOF'
52# Speedtest Tracker
53SPEEDTEST_PORT=8080
54INFLUX_PORT=8086
55INFLUX_USER=admin
56INFLUX_PASSWORD=influx_password
57GRAFANA_PORT=3000
58GRAFANA_PASSWORD=admin
59EOF
60
61# 3. Start the services
62docker compose up -d
63
64# 4. View logs
65docker compose logs -f

One-Liner

Run this command to download and set up the recipe in one step:

terminal
1curl -fsSL https://docker.recipes/api/recipes/speedtest-tracker-stack/run | bash

Troubleshooting

  • Speedtest CLI not found or failing: Ensure container has internet access and Speedtest servers are reachable from your network location
  • InfluxDB connection refused from Speedtest Tracker: Verify INFLUX_USER credentials and check that InfluxDB initialization completed successfully with docker logs speedtest-influxdb
  • Grafana shows no data from InfluxDB: Confirm InfluxDB data source configuration uses correct bucket name 'speedtest' and organization 'homelab' with proper authentication token
  • Speed tests not running on schedule: Check Speedtest Tracker logs for cron execution errors and verify SPEEDTEST_SCHEDULE environment variable format
  • InfluxDB out of memory errors: Increase container memory limits or configure data retention policies to automatically delete old speedtest data
  • Grafana dashboard queries timing out: Optimize InfluxDB queries using appropriate time ranges and consider using InfluxDB continuous queries for pre-aggregated data

Community Notes

Loading...
Loading notes...

Download Recipe Kit

Get all files in a ready-to-deploy package

Includes docker-compose.yml, .env template, README, and license

Ad Space