SoFunction
Updated on 2025-03-10

The implementation steps of Docker building LibreSpeed

LibreSpeed ​​is a lightweight network speed testing tool written in JavaScript and transfers data through XMLHttpRequest and Web Workers without Flash, Java or WebSocket support. LibreSpeed ​​provides a local deployment solution similar to Speedtest by Ookla, which can be quickly deployed on Docker-enabled platforms. It can provide test results for latency, jitter and uplink bandwidth, and is suitable for a variety of scenarios, such as speed testing of home or enterprise internal networks, network performance evaluation of educational environments, etc.

Application scenarios

  • Home Network Testing: Detect whether the speed of home broadband meets the standards promised by service providers.
  • Enterprise Network Assessment: Deploy on-site to evaluate network connection quality in different office locations.
  • Educational environment: Used in school networks to help IT administrators understand network conditions and optimize network layout.
  • Multi-node testing: By deploying multiple LibreSpeed ​​servers, you can conduct multi-point testing to understand the overall performance of the network.

Build LibreSpeed ​​using the Docker CLI

Pull the mirror

docker pull /linuxserver/librespeed

Start the container

docker run -d \
  --name=librespeed \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=Asia/Shanghai \
  -p 80:80 \
  -v /path/to/config:/config \
  /linuxserver/librespeed

Parameter explanation

  • -d: Run containers in the background.
  • --name=librespeed: Assign a name to the container.
  • -e PUID=1000: Set the user ID of the container.
  • -e PGID=1000: Set the group ID of the container.
  • -e TZ=Asia/Shanghai: Set the time zone of the container.
  • -p 80:80: Map port 80 of the container to port 80 of the host.
  • -v /path/to/config:/config: Mount the configuration file directory.
  • /linuxserver/librespeed: The Docker image address used.

Build LibreSpeed ​​with Docker Compose

Create a file

version: '3.7'
services:
  librespeed:
    container_name: librespeed
    image: /linuxserver/librespeed:latest
    restart: always
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Asia/Shanghai
    ports:
      - "80:80"
    volumes:
      - /path/to/config:/config

Start the service

docker-compose up -d

Parameter explanation

  • version: Docker Compose file version.
  • services: Define the service.
  • container_name: The container name of the service.
  • image: Docker image used.
  • restart: Container restart policy.
  • environment: Set environment variables.
  • ports: Port mapping.
  • volumes: Mount the data volume.

The following are the environment variable parameters supported by LibreSpeed ​​and their functions:

  • PUID: User ID where the container runs.
  • PGID: The group ID of the container running.
  • TZ: Time zone setting of the container.
  • PASSWORD: Password to access the statistics page (if setTELEMETRY)。
  • CUSTOM_RESULTS: Whether to allow custom result pages.
  • DB_TYPE: Database type (default is SQLite).
  • DB_NAME: Database name.
  • DB_HOSTNAME: The address of the database server.
  • DB_USERNAME: Database username.
  • DB_PASSWORD: Database password.
  • DB_PORT: Database port.

Through the above steps, you can successfully build the LibreSpeed ​​service and conduct network speed tests as needed.

This is the article about the implementation steps of Docker building LibreSpeed. For more related content on Docker building LibreSpeed, please search for my previous articles or continue browsing the related articles below. I hope everyone will support me in the future!