|
| 1 | +A docker version of LibreSpeed is available on docker hub: [https://hub.docker.com/r/adolfintel/speedtest/](https://hub.docker.com/r/adolfintel/speedtest/) |
| 2 | + |
| 3 | +## Downloading from Docker hub |
| 4 | +To download LibreSpeed from the docker hub, use this command: |
| 5 | + |
| 6 | +``` |
| 7 | +docker pull adolfintel/speedtest |
| 8 | +``` |
| 9 | + |
| 10 | +You will now have a new docker image called `adolfintel/speedtest`. |
| 11 | + |
| 12 | +## Standalone mode |
| 13 | +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`. |
| 14 | + |
| 15 | +The test can be accessed on port 80. |
| 16 | + |
| 17 | +Here's a list of additional environment variables available in this mode: |
| 18 | +* __`TITLE`__: Title of your speedtest. Default value: `LibreSpeed` |
| 19 | +* __`TELEMETRY`__: Whether to enable telemetry or not. Default value: `false` |
| 20 | +* __`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` |
| 21 | +* __`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` |
| 22 | +* __`PASSWORD`__: Password to access the stats page. If not set, stats page will not allow accesses. |
| 23 | +* __`EMAIL`__: Email address for GDPR requests. Must be specified when telemetry is enabled. |
| 24 | +* __`IPINFO_APIKEY`__: API key for ipinfo.io. Optional, but required if you expect to serve a large number of tests |
| 25 | +* __`DISABLE_IPINFO`__: If set to true, ISP info and distance will not be fetched from ipinfo.io. Default: value: `false` |
| 26 | +* __`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` |
| 27 | +* __`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 argument |
| 28 | + |
| 29 | +If telemetry is enabled, a stats page will be available at `http://your.server/results/stats.php`, but a password must be specified. |
| 30 | + |
| 31 | +###### Example |
| 32 | +This command starts LibreSpeed in standalone mode, with the default settings, on port 80: |
| 33 | + |
| 34 | +``` |
| 35 | +docker run -e MODE=standalone -p 80:80 -it adolfintel/speedtest |
| 36 | +``` |
| 37 | + |
| 38 | +This command starts LibreSpeed in standalone mode, with telemetry, ID obfuscation and a stats password, on port 86: |
| 39 | + |
| 40 | +``` |
| 41 | +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 |
| 42 | +``` |
| 43 | + |
| 44 | +## Multiple Points of Test |
| 45 | +For multiple servers, you need to set up 1+ LibreSpeed backends, and 1 LibreSpeed frontend. |
| 46 | + |
| 47 | +### Backend mode |
| 48 | +In backend mode, LibreSpeed provides only a test point with no UI. To do this, set the `MODE` environment variable to `backend`. |
| 49 | + |
| 50 | +The following backend files can be accessed on port 80: `garbage.php`, `empty.php`, `getIP.php` |
| 51 | + |
| 52 | +Here's a list of additional environment variables available in this mode: |
| 53 | +* __`IPINFO_APIKEY`__: API key for ipinfo.io. Optional, but required if you expect to serve a large number of tests |
| 54 | + |
| 55 | +###### Example: |
| 56 | +This command starts LibreSpeed in backend mode, with the default settings, on port 80: |
| 57 | +``` |
| 58 | +docker run -e MODE=backend -p 80:80 -it adolfintel/speedtest |
| 59 | +``` |
| 60 | + |
| 61 | +### Frontend mode |
| 62 | +In frontend mode, LibreSpeed serves clients the Web UI and a list of servers. To do this: |
| 63 | +* Set the `MODE` environment variable to `frontend` |
| 64 | +* Create a servers.json file with your test points. The syntax is the following: |
| 65 | + ``` |
| 66 | + [ |
| 67 | + { |
| 68 | + "name": "Friendly name for Server 1", |
| 69 | + "server" :"//server1.mydomain.com/", |
| 70 | + "dlURL" :"garbage.php", |
| 71 | + "ulURL" :"empty.php", |
| 72 | + "pingURL" :"empty.php", |
| 73 | + "getIpURL" :"getIP.php" |
| 74 | + }, |
| 75 | + { |
| 76 | + "name": "Friendly name for Server 2", |
| 77 | + "server" :"https://server2.mydomain.com/", |
| 78 | + "dlURL" :"garbage.php", |
| 79 | + "ulURL" :"empty.php", |
| 80 | + "pingURL" :"empty.php", |
| 81 | + "getIpURL" :"getIP.php" |
| 82 | + }, |
| 83 | + ...more servers... |
| 84 | + ] |
| 85 | + ``` |
| 86 | + Note: if a server only supports HTTP or HTTPS, specify the protocol in the server field. If it supports both, just use `//`. |
| 87 | +* Mount this file to `/servers.json` in the container (example at the end of this file) |
| 88 | + |
| 89 | +The test can be accessed on port 80. |
| 90 | +
|
| 91 | +Here's a list of additional environment variables available in this mode: |
| 92 | +* __`TITLE`__: Title of your speedtest. Default value: `LibreSpeed` |
| 93 | +* __`TELEMETRY`__: Whether to enable telemetry or not. Default value: `false` |
| 94 | +* __`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` |
| 95 | +* __`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` |
| 96 | +* __`PASSWORD`__: Password to access the stats page. If not set, stats page will not allow accesses. |
| 97 | +* __`EMAIL`__: Email address for GDPR requests. Must be specified when telemetry is enabled. |
| 98 | +* __`DISABLE_IPINFO`__: If set to true, ISP info and distance will not be fetched from ipinfo.io. Default: value: `false` |
| 99 | +* __`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` |
| 100 | +* __`WEBPORT`__: Allows choosing a custom port for the included web server. Default value: `80` |
| 101 | +
|
| 102 | +###### Example |
| 103 | +This command starts LibreSpeed in frontend mode, with a given `servers.json` file, and with telemetry, ID obfuscation, and a stats password: |
| 104 | +``` |
| 105 | +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 |
| 106 | +``` |
0 commit comments