How to Build Your Own Speed Test Server: OpenSpeedTest Setup Guide
OpenSpeedTest is a lightweight HTML5 network performance tool that weighs just 8kB. This open-source tool lets you control your speed testing environment without relying on third-party servers. You can run complete network performance tests right from your infrastructure.
The tool works on platforms of all types – Windows, Mac, Linux, Android, and iOS. This makes it perfect for wifi speed tests and network stability monitoring. The system supports web servers like Nginx, Apache, and IIS. Users can choose between simple and advanced features based on their needs. OpenSpeedTest is a great way to get quick speed checks or set up year-long performance monitoring. The tool adapts to your specific testing requirements.
Let us show you how to set up your own speed test server with OpenSpeedTest. We’ll cover everything from the original installation to advanced configuration and optimization techniques.
OpenSpeedTest Server Requirements
You need to carefully plan your hardware, network, and system requirements to set up an OpenSpeedTest server that performs well. Let’s look at the key components that are the foundations of a reliable speed testing environment.
Hardware Specifications for Optimal Performance
Your OpenSpeedTest server’s performance depends more on CPU capabilities than memory specs. The best results come from processors with higher instructions per cycle (IPC) and faster cores, not just more cores [1]. Single-socket board designs work better than multi-socket setups [1].
The minimum memory requirement starts at 16GB, but 32GB to 64GB works well to handle many concurrent clients [1]. Chelsio and Mellanox network interface cards (NICs) give you the best performance. Intel NICs are a great budget option that still performs well [1].
Network Bandwidth Requirements
Network capacity is vital for accurate speed testing. Servers in smaller markets need a minimum of 1 Gbps upstream and downstream network capacity [2]. Developed markets and city areas need at least 10 Gbps capacity. Many large network operators now use servers that can handle 40 Gbps or 100 Gbps [2].
Here’s what affects network performance:
- Network overhead usually brings testing speeds down to 900-950 Mbps on 1 Gbps connections
- 10 Gbps servers typically reach testing speeds of 6-7 Gbps based on destination servers [3]
- Traditional SATA drives can slow down testing, so NVMe drives or RAID setups help avoid these limits [3]
Operating System Compatibility
OpenSpeedTest works well with many operating systems. Here’s what you should think about for server deployment:
- Linux platforms, especially Ubuntu LTS versions with regular updates, work best for Docker-based installations [1]
- RHEL/CentOS 7 or newer versions run smoothly with modern kernel improvements to the network subsystem [1]
- Windows and macOS support Docker but work better for development than production [4]
Your server will perform better if you turn off hyperthreading or SMT. These features can cause random performance issues and affect latency [5]. Good cooling systems are essential because temperature management substantially affects system performance during heavy workloads [5].
Docker-Based Installation Steps
Docker makes OpenSpeedTest deployment simple with its containerized approach. You’ll get consistent performance no matter where you run it. Let me walk you through the installation steps.
Setting Up Docker Environment
Your system needs Docker set up correctly before you can install OpenSpeedTest. Docker works best on Linux platforms. MacOS and Windows environments work too, but we used them mainly for development [6]. After you install Docker, check if it’s running properly through your system’s terminal.
Pulling OpenSpeedTest Image
The official OpenSpeedTest Docker image uses [nginxinc/nginx-unprivileged:stable-alpine](https://hub.docker.com/r/openspeedtest/latest)
. This image helps you save system resources [6]. You can get the image by running this command:
sudo docker run --restart=unless-stopped --name openspeedtest -d -p 3000:3000 -p 3001:3001 openspeedtest/latest
Container Configuration
You can customize your OpenSpeedTest deployment with these advanced options:
- Port Configuration: Change default ports by setting environment variables:
CHANGE_CONTAINER_PORTS=True HTTP_PORT=3000 HTTPS_PORT=3001
- Security Settings: Set up CORS restrictions by listing allowed domains:
ALLOW_ONLY=domain1.com;domain2.com;domain3.com
To improve security, set up SSL certificates. You can mount your SSL directory with:
-v /${PATH-TO-SSL-CERTIFICATE}:/etc/ssl/
Testing Server Deployment
After deployment, you can reach your speed test server at:
- HTTP:
http://YOUR-IP:3000
- HTTPS:
https://YOUR-IP:3001
Here’s what you should remember for production setups:
- Set post-body content length to 35 megabytes when using a reverse proxy [6]
- Use
--restart=unless-stopped
flag to restart containers automatically - Use
SET_SERVER_NAME
variable to identify your servers easily
The container runs NGINX as an unprivileged user. This setup improves security without affecting performance [6]. Your server will pick the best connection settings based on network conditions once it’s up and running.
Network Configuration Guide
The right network configuration will give your OpenSpeedTest server the best performance and security. Your speed test results will stay consistent in different network environments if you follow these setup guidelines.
Port Forwarding Setup
Your OpenSpeedTest needs specific ports to run without interruption. Set up your network to forward these ports:
- Port 3000 for HTTP connections
- Port 3001 for HTTPS connections [7]
The local port settings should match container ports to improve functionality. You might need to change these default ports based on your network needs or if other services already use them [8].
SSL Certificate Implementation
SSL certificates create encrypted connections that boost security. OpenSpeedTest works with Let’s Encrypt certificates and can renew them automatically. You’ll need:
- A public IPv4/IPv6 address
- Domain name resolution to server IP
- Valid email address [7]
The command to enable Let’s Encrypt SSL:
docker run -e ENABLE_LETSENCRYPT=True
-e DOMAIN_NAME=speedtest.yourdomain.com
-e [email protected]
-e VERIFY_OWNERSHIP="TXT-FILE-CONTENT"
--restart=unless-stopped
--name openspeedtest -d
-p 80:3000 -p 443:3001 openspeedtest/latest
Firewall Rules Configuration
Good firewall settings protect your speed test server effectively. Your firewall setup should:
- Allow incoming traffic on ports 3000 and 3001
- Enable POST requests with content-length up to 35MB
- Accept ‘GET, POST, OPTIONS’ methods from authorized domains
- Configure Content-Type for application/octet-stream [7]
Reverse proxy setups need a post-body content length of 35 megabytes or more [7]. NGINX users should turn off gzip compression and use these settings:
client_max_body_size 35m;
gzip off;
tcp_nodelay on;
tcp_nopush on;
sendfile on;
These configurations help optimize data transfer and prevent speed measurement bottlenecks [9]. You can control access to your speed test server by setting up CORS restrictions through environment variables [4].
Performance Optimization Techniques
Your OpenSpeedTest server’s reliability and performance will improve with proper fine-tuning. The right optimization techniques can streamline the efficiency of speed testing infrastructure.
NGINX Server Tuning
The accuracy of speed tests depends on NGINX configuration parameters. The server needs these essential adjustments:
ssl_session_cache shared:SSL:100m;
ssl_session_timeout 1d;
client_max_body_size 35m;
open_file_cache max:200000 inactive:20s;
These settings make the server more responsive by managing SSL sessions effectively [9]. Static file handling works better with these caching directives:
open_file_cache_valid 45s;
open_file_cache_min_uses 2;
open_file_cache_errors off;
Load Balancing Setup
Load balancing needs a different approach than traditional methods. Best results come from:
- Avoiding proxy setups of multiple OpenSpeedTest servers behind one address
- Using DNS A records to deploy an active-active topology
- Setting up each server independently without load balancer overhead [5]
High-availability scenarios work best with DNS-based distribution where servers maintain direct client connections. This method gives accurate speed measurements without creating artificial bottlenecks [10].
Monitoring Tools Integration
Server reliability depends on continuous performance monitoring. These monitoring aspects matter most:
- Network Performance Metrics:
- Bandwidth utilization tracking
- Latency measurements
- Packet loss detection
- Jitter analysis [11]
- Server Health Indicators:
- CPU utilization patterns
- Memory usage trends
- Network interface statistics
Tools that track historical data help with comprehensive monitoring. They reveal performance trends and potential bottlenecks [12]. Quick issue detection happens through automated alerts, particularly when:
- Speed falls below set thresholds
- Tests fail
- Servers become unreachable [13]
Network performance changes based on power efficiency settings. IO schedulers should run in Performance mode rather than Power Savings mode to optimize bandwidth and reduce latency [5]. TCP congestion control algorithms help maintain optimal throughput by preventing network oversaturation [5].
Conclusion
Setting up your own speed test server with OpenSpeedTest gives you complete control over network performance testing and ensures data privacy and accuracy. This piece explores everything in creating a strong speed testing infrastructure.
Your experience starts with hardware requirements. CPU capabilities matter more than memory specs. Docker makes deployment simple and available on platforms of all types. Network configuration is a vital component that needs careful port forwarding and SSL setup to create secure testing environments.
Server performance stays at its peak through NGINX tuning and monitoring tool integration. These optimizations deliver accurate speed measurements without bottlenecks or slowdowns.
Want to see what your own speed testing infrastructure can do? Start a Speed Test Now and discover the benefits of controlling your network performance testing environment.
This self-hosted solution delivers great value to organizations that need consistent, reliable network performance data. Network speeds keep advancing rapidly. OpenSpeedTest’s efficient design and customization options make it perfect for deployments of all sizes – from small setups to large enterprise environments.
FAQs
Q1. What are the key requirements for setting up an OpenSpeedTest server?
To set up an OpenSpeedTest server, you’ll need a system with sufficient CPU capabilities, at least 16GB of RAM, and a network interface card capable of handling high speeds. The server should have a minimum of 1 Gbps network capacity, with 10 Gbps or higher recommended for developed markets.
Q2. How can I install OpenSpeedTest using Docker?
To install OpenSpeedTest using Docker, first ensure Docker is properly configured on your system. Then, pull the OpenSpeedTest image by running the command: sudo docker run --restart=unless-stopped --name openspeedtest -d -p 3000:3000 -p 3001:3001 openspeedtest/latest
. This will set up the container with default configurations.
Q3. What network configurations are necessary for optimal OpenSpeedTest performance?
For optimal performance, configure port forwarding for ports 3000 (HTTP) and 3001 (HTTPS). Implement SSL certificates for enhanced security. Set up firewall rules to allow incoming traffic on these ports and enable POST requests with content-length up to 35MB. Also, consider implementing CORS restrictions for controlled access.
Q4. How can I optimize the performance of my OpenSpeedTest server?
To optimize performance, tune your NGINX server settings, including SSL session management and file caching. Avoid proxying multiple servers behind a single address; instead, use DNS-based distribution for high availability. Integrate monitoring tools to track network performance metrics and server health indicators continuously.
Q5. Can OpenSpeedTest be used for automated speed testing?
While OpenSpeedTest itself is primarily a static webpage for on-demand testing, there are plans for developing a CLI client for automated tests. For now, you can explore alternative solutions like the internet-monitoring project by geerlingguy or use tools like speedtest-tracker for scheduled, automated speed tests with result logging and visualization.
References
[1] – https://support.ookla.com/hc/en-us/articles/234578628-Speedtest-Server-Requirements
[2] – https://www.ookla.com/articles/speedtest-server-network
[3] – https://www.servermania.com/kb/articles/test-server-speed
[4] – https://github.com/openspeedtest/Speed-Test/blob/main/README.md
[5] – https://support.ookla.com/hc/en-us/articles/360017436132-Optimizing-Server-Performance
[6] – https://hub.docker.com/r/openspeedtest/latest
[7] – https://openspeedtest.com/selfhosted-speedtest
[8] – https://m.youtube.com/watch?v=6m_–7QjMc0&t=0s
[9] – https://github.com/openspeedtest/Nginx-Configuration/blob/main/OpenSpeedTest-Server.conf
[10] – https://docs.openlitespeed.org/config/advanced/loadbalance/
[11] – https://www.paessler.com/network_speed_monitor
[12] – https://www.netdata.cloud/blog/speedtest-monitoring/
[13] – https://akashrajpurohit.com/blog/monitor-internet-speed-with-speedtest-tracker/