Setting up a Speedtest Tracker using Docker

In this tutorial, we will show you how to set up a Speedtest tracker using Docker.

Docker Internet Speedtest Tracker

An internet speedtest tracker allows you to monitor your internet performance easily. It is a great way to see if you are getting the speeds your ISP claims to offer while also being a helpful diagnostic tool.

There are various ways that you can set up an internet speedtest tracker. You can write your own custom tool like we did with our Raspberry Pi internet speed monitor guide, or you can use prebuilt software like in this tutorial.

To set up an internet speedtest tracker using Docker, we will be using a container by Alexjustesen. This container contains a piece of software that routinely performs speedtest’s using Ookla’s speedtest service. The results from these speedtests are then tracked and graphed so you can see how your internet performs.

The software we are using is one of the best solutions for tracking your internet speed. It just works straight out of the box. You don’t have to worry about setting up a separate service to track your data; everything is easily viewable and controllable through a modern web interface.

You can even follow this guide on a Raspberry Pi as long as you have a 64-bit operating system. The container we are using provides builds for both x64 and ARM64 architectures.

You can even set up this internet speedtest tracker on a Synology NAS if you wanted.

Installing the Internet Speedtest Tracker Using Docker

Over the next few sections, we will walk you through installing the internet speedtest tracker from a Docker container.

Most of these steps require you to use the terminal. If you are running a desktop variant of your operating system, you can often use the CTRL + ALT + T keyboard shortcut to open the terminal.

Preparing your System for the Speedtest Tracker

1. Before you can set up this internet speedtest tracker, you must have Docker installed on your system.

If you don’t have Docker installed, we highly recommend following our installation guide.

https://pimylifeup.com/linux-docker-install/

2. After installing Docker to your machine, we can now create a directory to store the Speedtest tracker and its configuration files.

You can create this directory by using the mkdir command within the terminal.

sudo mkdir -p /opt/stacks/speedtest

3. With the directory created, use the cd command to change to it. The rest of this guide will expect you to be in this folder.

cd /opt/stacks/speedtest

4. The other thing we will need before we can set up the speedtest tracker docker container is an app key.

The easiest way to generate a random app key is to head to the Speedtest tracker dev website in your favorite web browser.

https://speedtest-tracker.dev/

Once you are on this page, you can find a randomly generated app key at the bottom of this page. You will need this key for the next section.

An example of what this value should look like is shown below. Do not use this value for your own setup. Its just here to show you what it should look like.

base64:13MUJ1DX+WkYCOaHEHSo8llgwucfcRydRM3J5u/rMRo=

Writing a Docker Compose File for the Speedtest Tracker

5. We are at the point where we can begin to write the Docker Compose file that will set up and manage the internet speedtest tracker container.

A Compose file is a way of telling Docker how to set up and manage one, or many containers. It is significantly more straightforward to manage your container using these.

To begin to write this Compose file, use the following command in the terminal. We are using Nano as it is significantly simpler than other terminal-based text editors.

sudo nano compose.yaml

If you want a better way of managing these Docker containers, we highly recommend setting up Dockge.

Filling out the Docker Compose File

6. In this file, enter the following lines to set up the speedtest tracker Docker container.

As the speed test tracker is completely configured through environment variables, there are a few things you will need to do here.

  • <APPKEY>: You must replace this placeholder with the app key you generated at the end of the previous section. This key is used to encrypt and decrypt the database.
  • <TIMEZONE>: Here, you must specify the time zone of where your machine sits this ensures the speed test results will line up with your expected time. This timezone is specified using a TZ Identifier, you can find a list of these on Wikipedia.

    An example of a valid entry for this is: “Australia/Hobart“.
  • <CRON>: To run a speed test regularly, you must specify a cron schedule for the speed test Docker container to use. You can use our guide to learn how to write these cron jobs.

    Alternatively, if you want a test to be run at midnight every day, you can use the following “0 0 * * *“.
  • <SERVERS>: With this environment variable, you can specify the ID of a server, or multiple servers that you want to perform the speed tests against. This is a crucial step, as testing against one place will give you more consistent results.

    You can find a list of servers near you by going to the Speedtest website. On this page, you will greeted by an XML page with a list of servers. The value you want is specified after “id=“.

    For example, to connect to a Telstra server in Sydney we would specify the id “12492”. If we wanted to add another server to this list we would add a comma (,) followed by the id so it would end up like “12492,13279

    If you aren’t worried about the server used for your speed tests, delete this option.
  • <KEEPRESULTS>: Finally, you can decide how long you want to store your speed test results for. This value is expressed in a number of days.

    For example, to keep results for 7 days, you would specify 7.

    Alternatively, you must set this option to 0 to keep results forever. Be warned that your database will become quite bloated over time.
services:
    speedtest-tracker:
        container_name: speedtest-tracker
        ports:
            - 8080:80
            - 8443:443
        environment:
            - PUID=1000
            - PGID=1000
            - TZ=<TIMEZONE>
            - APP_KEY=<APPKEY>
            - APP_URL=http://localhost
            - DB_CONNECTION=sqlite
            - DISPLAY_TIMEZONE=<TIMEZONE>
            - SPEEDTEST_SCHEDULE=<CRON>
            - SPEEDTEST_SERVERS=<SERVERS>
            - PRUNE_RESULTS_OLDER_THAN=<KEEPRESULTS>
        volumes:
            - ./config:/config
        image: lscr.io/linuxserver/speedtest-tracker:latest
        restart: unless-stopped

Example of a Correct Docker Compose File for Speedtest Tracker

7. To give you an idea of how this file should be written. These are using our example values, but it should give you an idea if you are specifying something incorrectly.

services:
    speedtest-tracker:
        container_name: speedtest-tracker
        ports:
            - 8080:80
            - 8443:443
        environment:
            - PUID=1000
            - PGID=1000
            - TZ=Australia/Hobart
            - APP_KEY=base64:13MUJ1DX+WkYCOaHEHSo8llgwucfcRydRM3J5u/rMRo=
            - DB_CONNECTION=sqlite
            - DISPLAY_TIMEZONE=Australia/Hobart
            - SPEEDTEST_SCHEDULE=0 0 * * *
            - SPEEDTEST_SERVERS=12492,13279
            - PRUNE_RESULTS_OLDER_THAN=7
        volumes:
            - ./config:/config
        image: lscr.io/linuxserver/speedtest-tracker:latest
        restart: unless-stopped

Saving your Changes

8. After filling out this information, you can save and quit by pressing CTRL + X, Y, and then ENTER

Starting up the Speedtest Tracker Docker Container

9. Starting up the Speedtest tracker Docker container is as simple as using the following command within the terminal.

This command will download the container and start it up immediately. Additionally, since we are using the “-d” option, Docker will detach from the current terminal session once it has started.

docker compose up -d

Accessing the Web Interface

10. Now that you have the Speedtest tracker up and running you will want to access its web interface.

To access this interface, you will want to know the IP address of your machine. If you are hosting this locally, you can get the local IP address assigned to your machine by using the

hostname -I

11. Go to the following address to access the web interface in your favorite web browser.

Ensure you replace “<IPADDRESS>” with the IP you got in the previous step.

http://<IPADDRESS>:8080

Logging in and Changing the Default User

12. You must log in when you access your Docker-powered internet speedtest tracker. This software already has a default login that you can use, but it is something you will want to change immediately.

For your email address, type in “admin@example.com“, and “password” as your password (1.).

After entering the user details, click the “Sign in” button (2.).

Sign in to the Docker Internet Speed Tracker

13. Once logged in, you will want to adjust the default user to use your own username and password.

To begin this process, change to the “Users” tab using the sidebar.

Open Users Menu

14. After swapping to the users screen, you should see a list of every user that has been created. These users will have access to your Docker-based Internet Speedtest tracker.

Identify the root user and click the kebab icon next to it (1.). Clicking this will bring up a context menu. From this menu, click the “Edit” option (2.).

Edit default user for the Internet Speed Tracker

15. On this screen, you can specify a new email and password for your account (1.).

Once you are happy with your user’s new details, click the “Save changes” button (2.).

Update default users detail

16. Since we adjusted the default user, you will be automatically logged out and be required to log back in again.

Login using updated details

Running your First Speed Test

17. Running a speed test from this tracker is a really easy process. All you need to do is click the “Run Speedtest” button in the top-left corner (1.).

After clicking this button, a drop-down will appear with a single option, simply click “Ooka speedtest” to continue (2.).

Run first internet speed test from Docker container

18. You can check your current status by changing to the results tab using the left-hand sidebar.

On this screen, you can see each speed test that has been run from within the Docker container. You can even see tests that are still pending.

Results from the Docker Internet Speed Tracker

Updating to the Latest Version of the Speedtest Tracker Container

This section will be showing you how you can easily update to the latest version of the internet speedtest tracker container.

The update process is made significantly simpler thanks to using a Docker Compose file to run this container.

1. Your first step is to change to the directory where we wrote the Compose file. You must be in the same folder to simplify interacting with your containers.

If you have followed our guide, you can swap to the right place by using the following command.

cd /opt/stacks/speedtest

2. After changing to the correct location, you must get Docker to pull the latest version of the speedtest tracker container. To do this, you only need to run the following command.

This command will pull the latest image but will now upgrade any existing commands.

docker compose pull

3. If Docker downloaded a new release of the Internet Speedtest Tracker, you will want to move your container over to this new release.

To get Docker to do this, you only need to run the following command. Docker will scan the compose file, check if any image is available, and then restart that container with the new image.

docker compose up -d

Conclusion

If you have got to this point in the guide, you should have successfully set up the internet speed tracker software using Docker.

This software gives you a modern and simple-to-use interface to perform speed tests. It can routinely perform these tests and save these results to a database.

It is one of the coolest ways to keep an eye on your internet’s performance.

Please feel free to comment below if you have had any issues with getting this software up and running.

If you liked this tutorial, we recommend exploring our many other Docker guides to see what else you can self-host.

Leave a Reply

Your email address will not be published. Required fields are marked *

5 Comments

  1. Avatar for Chris
    Chris on

    Thank you for this, working perfectly. Now I have a leg to stand on when I complain to my ISP (Spectrum) about the speeds I pay for vs the actual speeds they serve me.

  2. Avatar for Gordon
    Gordon on

    Do not see a General setting after install

    1. Avatar for Emmet
      Emmet on
      Editor

      Hi Gordon,

      Unfortunately, the Speedtest tracker dev team removed the general settings page and moved it to being managed through environment variables.

      I have updated the tutorial to use the new environment variables, but it will require you to redo your Compose file.

      Please let me know if you have any additional issues.

      Kind regards,
      Emmet

  3. Avatar for Ric Morte
    Ric Morte on

    Hello,
    I tried this and the web interface is most impressive. However I got stuck with the final step: to create a schedule. The “general” tab is no longer present in the latest UI; instead the parameters are located in the environment variables.

    I shall have to come back to this later.

    1. Avatar for Emmet
      Emmet on
      Editor

      Hi Ric,

      Thank you for alerting us to this. I finally got around to it and have updated the tutorial to use the environment variables.

      Kind regards,
      Emmet