Skip to content

Repository files navigation

Speedtest Deployment

Deploys LibreSpeed as a rootless Podman container managed by podman compose. End users open a browser and test their LAN speed — no client installation required.

Prerequisites

  • Podman and podman-compose installed on the server
  • An external Podman network named www (shared with the reverse proxy)

Fresh server setup

Run the bootstrap script — it clones the repo, sets up the systemd service, and enables the nightly update timer:

curl -fsSL https://raw.githubusercontent.com/CollegiumAcademicum/speedtest/main/setup.sh | bash

Then create the .env file and set a password for the results page:

cp ~/speedtest/.env.example ~/speedtest/.env
nano ~/speedtest/.env   # set SPEEDTEST_PASSWORD

Then pull the image and start:

cd ~/speedtest && ./start.sh

After this the container starts automatically at every boot.


Manual setup (alternative)

1. Clone the repo

git clone https://github.com/CollegiumAcademicum/speedtest.git /srv/containers/www/home/speedtest
ln -s /srv/containers/www/home/speedtest ~/speedtest
cd ~/speedtest

2. Configure

cp .env.example .env
nano .env   # set SPEEDTEST_PASSWORD

3. Install the systemd service

sudo cp speedtest.service        /etc/systemd/system/
sudo cp speedtest-update.service /etc/systemd/system/
sudo cp speedtest-update.timer   /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable speedtest.service
sudo systemctl enable --now speedtest-update.timer

4. Start

./start.sh

Reverse proxy

The container listens on port 80 and is attached to the external www network.

Caddy

Point Caddy at the container name librespeed. The flush_interval -1 ensures the garbage data is streamed immediately rather than buffered:

speedtest.example.com {
    reverse_proxy http://librespeed:80 {
        flush_interval -1
    }
}

HTTP/2 and throughput: Caddy's HTTP/2 flow control significantly limits download speeds for large transfers like speedtests. On the www host, H2 was disabled globally in /srv/containers/www/etc/Caddyfile to achieve acceptable results (~180 Mbps vs ~80 Mbps with H2):

{
    debug
    servers {
        protocols h1
    }
}

This has no practical impact on the other services behind the same Caddy instance (all simple low-traffic internal tools with minimal assets).

ca-ingress (nginx stream)

Add to both map blocks in /etc/nginx/nginx.conf on ca-ingress:

# stream block (HTTPS passthrough)
speedtest.ca-hd.de www.intranet.ca-hd.de:443;

# http block (HTTP redirect)
speedtest.ca-hd.de www.intranet.ca-hd.de:80;

Reload: podman exec <nginx-container> nginx -t && podman exec <nginx-container> nginx -s reload


Update

Images are pulled and the container is restarted automatically every night at 03:00. To update manually:

podman compose pull && ./start.sh

Directory structure

~/speedtest/
├── docker-compose.yaml
├── speedtest.service           # systemd unit (installed by setup.sh)
├── speedtest-update.service    # pulls latest image and restarts
├── speedtest-update.timer      # fires nightly at 03:00
├── .env.example                # copy to .env and fill in SPEEDTEST_PASSWORD
├── setup.sh                    # bootstrap script for fresh servers
├── start.sh
└── stop.sh

Common commands

podman compose logs speedtest    # container logs
podman compose restart speedtest # restart the container
podman compose down              # stop everything

Troubleshooting

Container not reachable from the reverse proxy

Check the container is on the www network:

podman network inspect www

Port blocked by firewall

# Fedora/RHEL
sudo firewall-cmd --add-service=http --permanent && sudo firewall-cmd --reload
# Debian/Ubuntu
sudo ufw allow http

Service not starting at boot

sudo systemctl status speedtest.service
journalctl -u speedtest.service

About

lightweight speedtest deployment on the www vm for internel speedtests

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages