Let’s setup the most useful companion container to Gluetun, Speedtest Tracker. Speedtest Tracker runs Ookla Speedtest on a schedule of your choosing to measure the throughput of your gluetun VPN connection.
First, open your existing docker-compose.yml and add a new service:
speedtest-tracker:
image: lscr.io/linuxserver/speedtest-tracker:latest
container_name: speedtest-tracker
depends_on:
- gluetun
environment:
- PUID=65534
- PGID=65534
- SPEEDTEST_SCHEDULE=0 */12 * * *
- TZ=America/Chicago
- DB_CONNECTION=sqlite
- APP_KEY=[app key from https://speedtest-tracker.dev/]
volumes:
- [local path to config dir]:/config
restart: unless-stopped
network_mode: "service:gluetun"
You need to add an APP_KEY. You can get one by going to https://speedtest-tracker.dev and copying the APP_KEY listed at the bottom of the page.
Then add your local config directory. I’m using /Container/media/speedtest-tracker_config
Pay special attention to the PUID and GUID. I'm using the standard guest:guest or nobody:nogroup. The local config directory you choose must have the permissions to allow that user.
SPEEDTEST_SCHEDULE is in the format of cron. Here's a cron expression generator if you need help.
Finally, add the port for Speedtest Tracker to your gluetun config in the same docker-compose file. I use port 9000.
gluetun:
image: qmcgaw/gluetun:latest #v3
container_name: media-gluetun
cap_add:
- NET_ADMIN
network_mode: bridge
ports:
- 9000:80/tcp # speedtest-tracker
Save and exit docker-compose.yml and run docker-compose up, or whatever method you use for your docker-compose file. Speedtest Tracker is now up, with a schedule to test every 12 hours. Since I used port 9000, I can go to http://[your docker system IP address]:9000/ and login with the default user of “[admin@example.com](mailto:admin@example.com)" and the default password of "password"
The webpage contains tons of useful information and graphs showing your VPN connections speed, ping, jitter and latency. It also shows when the next automated check will occur. Remember your gluetun VPN may rotate to different endpoints depending on your configuration, causing sharp swings in the metrics.
You can get more information about Speedtest-Tracker here: https://docs.speedtest-tracker.dev/
Finally, let's add this to our Homepage dashboard. See my howto here if you need to setup Homepage.
Edit your services.xml and add the service configuration under the Gluetun service. For my config, that's "vi /Container/media/homepage_config/services.yaml"
- Speedtest:
icon: speedtest-tracker.png
href: http://[your docker system ip]:9000
description: Bandwidth monitor
server: my-docker
container: speedtest-tracker
widget:
type: speedtest
url: http://127.0.0.1:80
Make note of the port in the href and url. In the href, it should be the port you used in your docker-compose.yml file. The 'href' tag lets you click on the Speedtest-Tracker service in Homepage and go directly to the Speedtest-Tracker dashboard. The widget 'url' should be 80 here, as we are querying the API from inside the gluetun network.