Self-Hosting OpenSpeedTest with Docker Compose

What Is OpenSpeedTest?

Unlike commercial speed tests that route traffic through third-party servers and collect your data, OpenSpeedTest runs entirely on your own hardware. It’s an HTML5-based network speed test that measures download, upload, latency, and jitter between any device on your network and your server. No Flash, no Java, no app installation — just open a browser and test.

OpenSpeedTest is useful for two things: testing your internet connection speed without third-party involvement, and testing internal LAN throughput between devices and your server. The second use case is where self-hosting it really shines — commercial speed test sites can’t measure your internal network performance.

Prerequisites

  • A Linux server (Ubuntu 22.04+ recommended)
  • Docker and Docker Compose installed (guide)
  • 128 MB of free RAM
  • Adequate network bandwidth (the test maxes out whatever link it can)

Docker Compose Configuration

Create a directory for OpenSpeedTest:

mkdir -p /opt/openspeedtest && cd /opt/openspeedtest

Create a docker-compose.yml:

services:
  openspeedtest:
    image: openspeedtest/latest:v2.0.6
    container_name: openspeedtest
    ports:
      - "3000:3000"   # HTTP
      - "3001:3001"   # HTTPS (self-signed)
    environment:
      SET_SERVER_NAME: "Home Lab Speed Test"  # Display name in the UI
    restart: unless-stopped

Start it:

docker compose up -d

That’s it. No database, no volumes, no dependent services.

Initial Setup

Open http://your-server-ip:3000 in any browser. The speed test interface loads immediately. Click Start to begin testing.

TestWhat It Measures
DownloadServer → Client throughput (Mbps)
UploadClient → Server throughput (Mbps)
PingRound-trip latency (ms)
JitterLatency variance (ms)

Testing LAN vs WAN

  • From a device on the same LAN: Measures your internal network throughput (switch speed, WiFi speed)
  • From outside your network (via VPN or port forward): Measures internet connection speed
  • From another server: Measures inter-server bandwidth

Configuration

Environment Variables

VariableDefaultPurpose
SET_SERVER_NAMEDisplay name shown in the test UI
ALLOW_ONLYRestrict CORS to specific domains
ENABLE_LETSENCRYPTEnable built-in Let’s Encrypt SSL
DOMAIN_NAMEDomain for Let’s Encrypt certificate
USER_EMAILEmail for Let’s Encrypt notifications
SET_USERRun as unprivileged user (UID)
HTTP_PORT3000Custom HTTP port inside container
HTTPS_PORT3001Custom HTTPS port inside container

Built-in SSL With Let’s Encrypt

If exposing directly (without a reverse proxy):

services:
  openspeedtest:
    image: openspeedtest/latest:v2.0.6
    container_name: openspeedtest
    ports:
      - "80:3000"
      - "443:3001"
    environment:
      ENABLE_LETSENCRYPT: "true"
      DOMAIN_NAME: "speedtest.yourdomain.com"
      USER_EMAIL: "[email protected]"
    restart: unless-stopped

Custom SSL Certificate

Mount your own certificate:

volumes:
  - /path/to/nginx.crt:/etc/ssl/nginx.crt:ro
  - /path/to/nginx.key:/etc/ssl/nginx.key:ro

The certificate files must be named exactly nginx.crt and nginx.key.

Restricting Access

Limit which domains can embed or access the speed test:

environment:
  ALLOW_ONLY: "yourdomain.com"

Reverse Proxy

For HTTPS access through an existing reverse proxy, use Nginx Proxy Manager or Caddy:

Caddy:

speedtest.yourdomain.com {
    reverse_proxy localhost:3000
}

Important: Speed tests generate large data transfers. Ensure your reverse proxy doesn’t impose request body size limits that would cap upload tests. In Nginx Proxy Manager, increase client_max_body_size to at least 100M.

See Reverse Proxy Setup for detailed configuration.

Backup

OpenSpeedTest stores no persistent data. The container is stateless — no database, no configuration files, no test results. To rebuild, just redeploy the container.

The only “backup” needed is your docker-compose.yml file. See Backup Strategy for general Docker backup guidance.

Troubleshooting

Speed Test Shows Much Lower Than Expected Results

Symptom: LAN speed test shows 100 Mbps instead of expected gigabit

Fix: Check for bottlenecks in order:

  1. WiFi vs Ethernet — WiFi rarely exceeds 400-600 Mbps real-world. Test from a wired device.
  2. Browser limitations — Some browsers throttle WebSocket connections. Try Chrome or Firefox.
  3. Reverse proxy buffering — If behind a proxy, disable buffering for the speed test domain.
  4. Docker network — Use network_mode: host for maximum throughput on LAN tests:
services:
  openspeedtest:
    image: openspeedtest/latest:v2.0.6
    network_mode: host
    restart: unless-stopped

HTTPS Certificate Errors

Symptom: Browser warns about self-signed certificate on port 3001

Fix: The built-in HTTPS uses a self-signed certificate by default. Either use the HTTP port (3000) behind a reverse proxy with proper SSL, or mount your own certificate, or enable Let’s Encrypt.

Test Doesn’t Start

Symptom: Clicking Start does nothing or shows “Connection failed”

Fix: Verify the container is running and the port is accessible:

docker compose ps
curl -I http://localhost:3000

Check browser console for WebSocket connection errors. Some corporate firewalls block WebSocket connections.

Resource Requirements

ResourceValue
RAM~50 MB idle
CPULow idle; scales with concurrent tests (Nginx serving data)
Disk~110 MB (container image only — no persistent storage)
NetworkGenerates maximum throughput during tests — plan accordingly

Verdict

OpenSpeedTest is the simplest self-hosted app in this category — a single container, zero configuration, works instantly. The primary value is LAN throughput testing and private internet speed testing without third-party data collection. It replaces Ookla’s speed test for anyone who doesn’t want their test data sent to a third party.

For continuous bandwidth monitoring and historical tracking, look at LibreSpeed (which stores results) or Speedtest Tracker (which automates periodic tests and graphs history). OpenSpeedTest is the on-demand, zero-state option.

FAQ

Does OpenSpeedTest store test results?

No. All tests run client-side in the browser. No results are stored on the server. If you need historical speed test data, use Speedtest Tracker.

Can I test from outside my network?

Yes — expose the port through a VPN (Tailscale, WireGuard) or reverse proxy. The test then measures your internet connection speed between the client and your server.

How accurate is it compared to Ookla?

For internet speed tests, results are comparable to Ookla and Fast.com. For LAN tests, OpenSpeedTest is more useful than commercial tools because it tests directly to your server rather than a remote endpoint.

Comments