This Github Speedtest-x project is an extension of LibreSpeed, which is a pretty lightweight speedtest tool. Speedtest-x project uses file datebase to save speedtest results from various users. Thus you can check out different results from various countries/regions.

Features

  • Self-hosted lightweight speedtest page
  • User speedtest result datasheet
  • No MySQL, but lightweight file database
  • Use ip.sb to get IP info by default
My Forked Github: https://
Original Author’s Github: https://github.com/BadApple9/speedtest-x
Docker Hub Image: https://hub.docker.com/r/badapple9/speedtest-x

Test Sites:
Limitation: Sige in account every 7 days, else your services will be paused in 48 hours. 

Docker Run Deployment

One line command to bring your speedtest site up and runnin if you have your docker environment ready. 
Else you can check this post for howto set up your docker environment:
Run Docker using docker run command

  • docker run -d --name speedtest-x-en -p 9001:80 -it johnyan2/speedtest-x-en

-d:start it as a daemon mode

9001: default mapping internal port 80 to host port 9001

Environment variables :

-e WEBPORT=80: Internal Speedtest-x Docker Web Port . Default is 80.

-e MAX_LOG_COUNT=100: Maximum history numbers for saved test results. Default is 100.

-e IP_SERVICE=ip.sb: Which IP DB service provider( default is ip.sb or ipinfo.io)

-e SAME_IP_MULTI_LOGS=false: If allow save multiple results for same ip. Default is false. but strongly suggest to set it to True

Run Docker with multiple environment variables

  • docker run -d -e SAME_IP_MULTI_LOGS=true -e MAX_LOG_COUNT=500 -p 9001:80 -it johnyan2/speedtest-x-en
Speedtest-X Home Page:

Deploy to Own VPS

Not recommended to deploy it to other application platform such as fly.io, since those platforms are having limitation for the outbound/inbound througputs. It will be better for you to know the speed limitation on your VPS before deploying to it.

Speedtest-X Test History Result Page:

Make Docker Support ipv6

If you would like your docker to support IPv6, you can edit /etc/docker/daemon.json ,add following content into file, or create this new file if it doesn’t exist.

  • {
  • "ipv6": true,
  • "fixed-cidr-v6": "fd00::/80",
  • "experimental": true,
  • "ip6tables": true
  • }

Deploy Docker to Koyeb Platform

URL: https://www.koyeb.com/

Create Own Speedtest Docker Using Dockerfile

 

mkdir src
cd src 
wget https://github.com/51sec/speedtest-x-en/archive/refs/heads/master.zip
unzip master.zip
mv speedtest-x-en/* .
rm master.zip
rm -fr speedtest-x-en
vi Dockerfile
FROM php:7.2-apache
COPY src/ /var/www/html/
$ docker build -t speedtest .
Sending build context to Docker daemon  372.7kB
Step 1/2 : FROM php:7.2-apache
 —> c61d277263e1
Step 2/2 : COPY src/ /var/www/html/
 —> e25caaefbc8e
Successfully built e25caaefbc8e
Successfully tagged speedtest:latest
[node2] (local) [email protected] ~
$ docker run -dit –name st -p 80:80 speedtest
4aa7d58c485b1599518605c9bce98959cbdcc8c473b5f3807e633620777e706d
[node2] (local) [email protected] ~
$ docker exec -it st /bin/bash
You also can set up a Github action workflow to complete the process making docker image and upload to dockerhub.

Video

 

By netsec

Leave a Reply