OpenSpeedTest: Check the Speed of your LAN via Web Browser
Imagine you’re developing an application for your internal network that requires a certain network speed to function properly. You could open a web browser and point it to one of the many network speed tests on the market but I’m sure you know what that does… it tests your connection to the outside world.
What if you’re looking to test the speed of your LAN itself? Speedtest.net won’t be of much help, especially if you’re developing a LAN-only app or the app you’re planning on deploying to the world that is currently in alpha development stage. Having a grasp on network speeds can be a handy troubleshooting tool.
That’s where OpenSpeedTest comes in.
OpenSpeedTest is a free, open source HTML5 network performance estimation tool that doesn’t require any client-side software or plugin to function. Once deployed, the tool can be accessed from a standard, modern web browser. Even better, OpenSpeedTest can be deployed with Docker. It uses a combination of NGINX and Alpine Linux to use very little resources on your Docker server.
You can run OpenSpeedTest with or without LetsEncrypt SSL (with automatic certificate renewal). I’m going to show you how to do both.
What You’ll Need
To work with OpenSpeedTest, you’ll need a server to host the container and a user with sudo privileges. I’ll demonstrate this on Ubuntu Server 22.04, so if you’re using a different OS, you’ll need to alter the Docker installation instructions (but nothing more).
With that said, let’s get to it.
Installing Docker
As I’m not one to leave anything out, let me first show you how to install Docker on Ubuntu Server.
The first thing to take care of is downloading and installing the required Docker GPG key. Do this with the command:
1 |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg |
Once that command completes, add the official Docker repository with the command:
Install the required dependencies with:
1 |
sudo apt-get install apt-transport-https ca-certificates curl gnupg lsb-release -y |
Before you can run the Docker install, you must first update apt with the command:
1 |
sudo apt-get update |
It’s now time to install the community edition of Docker, along with the CLI tool and containerd, with the command:
1 |
sudo apt-get install docker-ce docker-ce-cli containerd.io -y |
To avoid running Docker with sudo (or admin) privileges, which can lead to serious security issues, you must add your user to the docker group with the command:
1 |
sudo usermod -aG docker $USER |
For the changes to take effect, log out and log back into your server.
You can verify everything is in working order by issuing the command:
1 |
docker ps |
All you should see in the output is:
1 |
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS |
Blamo! You’re ready to deploy containers.
Deploying OpenSpeedTest
First, I’ll show you how to deploy OpenSpeedTest without LetsEncrypt. For that, all you have to do is issue the command:
1 |
docker run --restart=unless-stopped --name openspeedtest -d -p 3000:3000 -p 3001:3001 openspeedtest/latest |
Give the container enough time to deploy (a couple of minutes should do the trick). When it’s deployed, open a web browser that’s on your LAN and point it to http://SERVER:3000 (where SERVER is the IP address of the hosting server). You should be presented with the OpenSpeedTest interface, where you can click Start (Figure 1) to run the speed test.
You can also use HTTPS (so your traffic is encrypted) with the address https://SERVER:3001 (where SERVER is the IP address of the hosting server).
Deploying OpenSpeedTest with LetsEncrypt Support
If you’d prefer to deploy the container with free LetsEncrypt SSL support, you will need the following:
- A public-facing IPV4 or IPV6 address.
- A domain name that resolves to the hosting server’s IP address.
- An email ID.
Once you have all of those things taken care of, the command to deploy OpenSpeedTest with LetsEncrypt SSL support is:
1 |
docker run -e ENABLE_LETSENCRYPT=True -e DOMAIN_NAME=yourdomain -e USER_EMAIL=youremail --restart=unless-stopped --name openspeedtest -d -p 80:3000 -p 443:3001 openspeedtest/latest |
Where yourdomain is the domain you have pointing to the hosting server and youremail is the email address you want to use as the ID.
When the container has successfully deployed, point a web browser to https://SERVER:443 (where SERVER is the domain of the hosting server). You should see the same page as shown above (in Figure 1).
And that’s all there is to deploying your own speed test tool for your LAN. With OpenSpeedTest, you can easily test the speed of your LAN, which can go a long way to help troubleshoot any issues with the apps and or services you are building.
Even if you’re not busy building an app or service, the tool is also handy for testing basic LAN network speeds or helping you to troubleshoot to see if your LAN is responding as it should.