I’ve been a computer nerd for a long, long time. The nerdiness comes through in not only my academic and software development background, but also in my tendency to tinker with old hardware, networking, services, etc. I’m also half a DINK with plenty of time and resources. Combine all of this with a pandemic and work-from-home and, I’ve found myself going hog wild on my home network. But how do I know I didn’t make things worse than they were when I started? The answer is Librespeed.
Librespeed is a great tool that I can self-host internally and confirm my network changes had the impact I expected. And since it’s hosted internally, my test results don’t include any uncertainty due to my home internet connection.
This post is about how I set it up using LinuxServer.io’s image.
LinuxServer.io describes their organization as:
A group of like-minded enthusiasts from across the world who build and maintain the largest collection of Docker images on the web. At our core are the principles behind Free and Open Source Software. Our primary goal is to provide easy-to-use and streamlined Docker images with clear and concise documentation.
I’ve been using LinuxServer.io images for a couple of years. That’s because they’re easy to use, clear, and concisely documented. I tend to check here first when I need a new image.
Regarding LinuxServer.io images and Portainer
The LinuxServer.io team explicitly does not support running their images via Portainer. Despite that, I recently have been trying it out and accepting the risk — so far, so good. But as soon as I run into any trouble, I will toss Portainer out the window and go back to `docker-compose` in a heartbeat.
In other words, run these images via Portainer at your own risk. But if you do it right, it’ll probably be just fine.
Librespeed Container Configuration
Let’s configure a new Librespeed instance within Portainer.
The specific steps
All of these steps are as of Portainer version 2.5.1 in summer 2021. Some of these settings may look dissimilar in different versions, though I would be surprised if they differed significantly.
- Create a persistent data directory for Librespeed. In my case, that command will be
- Login to your Portainer instance.
- Navigate to your containers environment. In my case, that’s in the
localenvironment, then Containers tab.
- Click the “Add container” button.
- Begin filling out the below fields.
librespeed(or whatever you want to call it. Since I will have only one, this nonspecific name is fine.)
- Registry: GitHub Container Registry
I prefer to pin my images to a specific version, but you can use whatever version or level of flexibility you prefer.
- Click the “Publish a new network port” button.
- Add a TCP port mapping for
30001:80. In my case, port 80 is already mapped externally by another container, so I chose 30001 for this one.
- Next, click the “Advanced container settings” tab.
- Click the “Volumes” tab.
- Click the “Map additional volume” button.
- Add a bind volume mapping of
- Click the Env tab and add three (or four) environment variables:
PUID=123(fill in the correct uid for your preferred user)
PGID=456(fill in the current gid for your preferred group)
TZ=America/Detroit(fill in the timezone code for your preferred timezone)
DB_TYPE=sqliteThis is not explicitly required and I believe is the default, but I prefer to call it out anyway.
- Click the “Restart policy” tab.
- Click the “Unless Stopped” button (or whatever your preferred policy is).
- Click the “Deploy the container” button.
Give this a few minutes, and your container should not be booted. Then, navigate to your system on port 30001, and you should be looking at Librespeed.
Librespeed Application Configuration and usage
There isn’t that much to configure with Librespeed. There are a few knobs to turn, and Techno Tim has a wonderful video about what you can do. I’ll refer you to his video for application configuration and usage.
Advantages of Librespeed
One thing I appreciate about Librespeed is its portability. For instance, if I’ve moved around my house and need to do a quick speed test, it works great from my phone. If I need to use it for more detailed debugging, I can get out my laptop and dig in more.
It is quite vanilla out of the box, and thus works well across all platforms. Sheer utility over aesthetics is exactly how I like it.
Big thanks to Techno Tim for the awareness of Librespeed, the great video tutorial, and the LinuxServer.io team for the image.