A docker version of LibreSpeed is available on docker hub: https://hub.docker.com/r/adolfintel/speedtest/
To download LibreSpeed from the docker hub, use this command:
docker pull adolfintel/speedtest
You will now have a new docker image called adolfintel/speedtest
.
If you want to install LibreSpeed on a single server, you need to configure it in standalone mode. To do this, set the MODE
environment variable to standalone
.
The test can be accessed on port 80.
Here's a list of additional environment variables available in this mode:
TITLE
: Title of your speedtest. Default value: LibreSpeed
TELEMETRY
: Whether to enable telemetry or not. Default value: false
ENABLE_ID_OBFUSCATION
: When set to true with telemetry enabled, test IDs are obfuscated, to avoid exposing the database internal sequential IDs. Default value: false
REDACT_IP_ADDRESSES
: When set to true with telemetry enabled, IP addresses and hostnames are redacted from the collected telemetry, for better privacy. Default value: false
PASSWORD
: Password to access the stats page. If not set, stats page will not allow accesses.EMAIL
: Email address for GDPR requests. Must be specified when telemetry is enabled.IPINFO_APIKEY
: API key for ipinfo.io. Optional, but required if you expect to serve a large number of testsDISABLE_IPINFO
: If set to true, ISP info and distance will not be fetched from ipinfo.io. Default: value: false
DISTANCE
: When DISABLE_IPINFO
is set to false, this specifies how the distance from the server is measured. Can be either km
for kilometers, mi
for miles, or an empty string to disable distance measurement. Default value: km
WEBPORT
: Allows choosing a custom port for the included web server. Default value: 80
. Note that you will have to expose it through docker with the -p argumentIf telemetry is enabled, a stats page will be available at http://your.server/results/stats.php
, but a password must be specified.
This command starts LibreSpeed in standalone mode, with the default settings, on port 80:
docker run -e MODE=standalone -p 80:80 -it adolfintel/speedtest
This command starts LibreSpeed in standalone mode, with telemetry, ID obfuscation and a stats password, on port 86:
docker run -e MODE=standalone -e TELEMETRY=true -e ENABLE_ID_OBFUSCATION=true -e PASSWORD="yourPasswordHere" -e WEBPORT=86 -p 86:86 -it adolfintel/speedtest
For multiple servers, you need to set up 1+ LibreSpeed backends, and 1 LibreSpeed frontend.
In backend mode, LibreSpeed provides only a test point with no UI. To do this, set the MODE
environment variable to backend
.
The following backend files can be accessed on port 80: garbage.php
, empty.php
, getIP.php
Here's a list of additional environment variables available in this mode:
IPINFO_APIKEY
: API key for ipinfo.io. Optional, but required if you expect to serve a large number of testsThis command starts LibreSpeed in backend mode, with the default settings, on port 80:
docker run -e MODE=backend -p 80:80 -it adolfintel/speedtest
In frontend mode, LibreSpeed serves clients the Web UI and a list of servers. To do this:
MODE
environment variable to frontend
[
{
"name": "Friendly name for Server 1",
"server" :"//server1.mydomain.com/",
"dlURL" :"garbage.php",
"ulURL" :"empty.php",
"pingURL" :"empty.php",
"getIpURL" :"getIP.php"
},
{
"name": "Friendly name for Server 2",
"server" :"https://server2.mydomain.com/",
"dlURL" :"garbage.php",
"ulURL" :"empty.php",
"pingURL" :"empty.php",
"getIpURL" :"getIP.php"
},
...more servers...
]
//
./servers.json
in the container (example at the end of this file)The test can be accessed on port 80.
Here's a list of additional environment variables available in this mode:
TITLE
: Title of your speedtest. Default value: LibreSpeed
TELEMETRY
: Whether to enable telemetry or not. Default value: false
ENABLE_ID_OBFUSCATION
: When set to true with telemetry enabled, test IDs are obfuscated, to avoid exposing the database internal sequential IDs. Default value: false
REDACT_IP_ADDRESSES
: When set to true with telemetry enabled, IP addresses and hostnames are redacted from the collected telemetry, for better privacy. Default value: false
PASSWORD
: Password to access the stats page. If not set, stats page will not allow accesses.EMAIL
: Email address for GDPR requests. Must be specified when telemetry is enabled.DISABLE_IPINFO
: If set to true, ISP info and distance will not be fetched from ipinfo.io. Default: value: false
DISTANCE
: When DISABLE_IPINFO
is set to false, this specifies how the distance from the server is measured. Can be either km
for kilometers, mi
for miles, or an empty string to disable distance measurement. Default value: km
WEBPORT
: Allows choosing a custom port for the included web server. Default value: 80
This command starts LibreSpeed in frontend mode, with a given servers.json
file, and with telemetry, ID obfuscation, and a stats password:
docker run -e MODE=frontend -e TELEMETRY=true -e ENABLE_ID_OBFUSCATION=true -e PASSWORD="yourPasswordHere" -v $(pwd)/servers.json:/servers.json -p 80:80 -it adolfintel/speedtest
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。