Setup Librespeed
Overview
Self-hosted Speed Test for HTML5 and more. Easy setup, examples, configurable, mobile friendly. Supports PHP, Node, Multiple servers, and more.
Changelog
- 2025-01-27
- Updating
docker-compose.ymlto be accessed through tailscale - Added
librespeed.jsonto appdata - Updated documentation
- Ended up creating a new network for
internal-dbfor access to databases - Need to remove
:443statements from/librespeed/config/nginx/site-confs/default.conffile.
- Updating
Important Tailscale File
librespeed.json
{
"TCP": {
"443": {
"HTTPS": true
}
},
"Web": {
"${TS_CERT_DOMAIN}:443": {
"Handlers": {
"/": {
"Proxy": "http://speed:80"
}
}
}
},
"AllowFunnel": {
"${TS_CERT_DOMAIN}:443": false
}
}
Important Docker Files
.env file
.env
ID=1000
TZ=America/New_York
NAME=librespeed
SUB=speed
APPDATA=
DOMAIN=
DB_NAME=librespeed
DB_USER=librespeed
DB_PASS=
docker-compose.yml file
docker-compose.yml
services:
librespeed:
image: lscr.io/linuxserver/librespeed
container_name: ${NAME}
restart: unless-stopped
environment:
PUID: ${ID}
PGID: ${ID}
TZ: ${TZ}
CUSTOM_RESULTS: false
DB_TYPE: postgresql
DB_NAME: ${DB_NAME}
DB_HOSTNAME: $NAME-db
DB_USERNAME: ${DB_USER}
DB_PASSWORD: ${DB_PASS}
volumes:
- ${APPDATA}/${NAME}/config:/config
networks:
- main
- internal-db
depends_on:
librespeed-db:
condition: service_healthy
labels:
swag: enable
swag_address: ${NAME}
swag_port: ${PORT}
swag_proto: http
swag_url: ${SUB}.${DOMAIN}
com.centurylinklabs.watchtower.enable: true
librespeed-db:
image: postgres:17-alpine
restart: always
container_name: ${NAME}-db
environment:
POSTGRES_DB: ${DB_NAME}
POSTGRES_PASSWORD: ${DB_PASS}
POSTGRES_USER: ${DB_USER}
healthcheck:
interval: 10s
retries: 10
test: "pg_isready -U ${DB_USER} -d ${DB_NAME}"
timeout: 2s
volumes:
- ${APPDATA}/${NAME}/${NAME}-db:/var/lib/postgresql/data
networks:
- internal-db
labels:
com.centurylinklabs.watchtower.enable: true
networks:
main:
external: true
internal-db:
external: true
Start the Container
Start the Container
docker compose up -d