2021/08/31
CPU | Quad Core, ≥3.0GHz |
Memory | 32-64GB |
Storage | ≥8GB |
NIC | ≥10Gbit/s |
OS | Debian 11 |
1. Create a new Unix user for the Speedtest service to run as.
adduser speedtest --disabled-password
2. Create a new directory for the speedtest server and change its ownership.
mkdir /opt/speedtest
chown speedtest:speedtest /opt/speedtest/
3. Login as the speedtest
user and navigate to the speedtest installation directory.
su - speedtest
cd /opt/speedtest
4. Download the installation script from Ookla.
wget https://install.speedtest.net/ooklaserver/ooklaserver.sh
5. Change the script's permissions to allow execution.
chmod a+x ooklaserver.sh
6. Run the script.
./ooklaserver.sh install
7. Modify the Speedtest server's config - /opt/speedtest/OoklaServer.properties
Find the line listed below and uncomment it.
#OoklaServer.allowedDomains = *.ookla.com, *.speedtest.net
The Ookla Speedtest Server will automatically start after the installation script runs. The following section will go over creating a systemd service to manage the Speedtest service.
1. Create a new systemd service file for the Speedtest service.
vim /etc/systemd/system/ooklaspeedtest.service
The service file:
[Unit]
Description=Ookla Speedtest service
After=network.target
After=systemd-user-sessions.service
After=network-online.target
[Service]
User=speedtest
ExecStart=/opt/speedtest/OoklaServer
Type=simple
TimeoutSec=15
Restart=on-failure
RestartSec=30
StartLimitInterval=350
StartLimitBurst=10
[Install]
WantedBy=multi-user.target
2. Reload systemd to enable the new service file.
systemctl daemon-reload
3. Enable the ooklaspeedtest
service.
systemctl enable ooklaspeedtest.service
4. Stop the instance of the Ookla Speedtest server that auto started after the installation. I chose to restart the server and let systemd auto start the service when it boots back up. Checking the status of the ooklaspeedtest.service
after the reboot shows that systemd did its job and started the service.
The following ports must be open for the Ookla Speedtest server to operate.
Use ufw
or firewalld
as your host firewall front-end.
ufw allow port 8080
ufw allow port 5060
ufw allow port 80 proto tcp
I'm going to create a custom service that specifies all the required ports.
vim /etc/network/ooklaspeedtest.xml
Use the following XML config
<?xml version="1.0" encoding="utf-8"?>
<service>
<port port="8080" protocol="tcp"/>
<port port="8080" protocol="udp"/>
<port port="5060" protocol="tcp"/>
<port port="5060" protocol="udp"/>
<port port="80" protocol="tcp"/>
</service>
Create the new service
firewall-offline-cmd --new-service-from-file=/etc/network/ooklaspeedtest.xml --name=OoklaSpeedtest
Reload
firewall-cmd --reload
Allow the service through the firewall
firewall-cmd --permanent --add-service=OoklaSpeedtest
Use the Ookla Server Tester to verify that your server is functioning properly.
The https section will show as failed - It can be ignored for now.
Now that the server is functional, it needs to be submitted to Ookla for approval to be part of their server network.
1. Register for an Ookla operator account here.
2. Add your new server here - test it here.
3. Wait for approval.
Once the server is approved, it should receive a certificate automatically and enable HTTPS.
Check Ookla's website for the latest server version.
To show your server's current Ookla version, use a web browser to navigate to
http://speedtest-server.domain.net:8080/hi
or use curl
curl speedtest-server.domain.net:8080/hi
From the CLI of the server, run the install script
/opt/speedtest/ooklaserver.sh install
In /opt/speedtest/OoklaServer.properties
logging is already configured to output to console (which ends up in daemon.log). Use this configuration to write logs to a dedicated log file:
# Log to files
#
logging.loggers.app.name = Application
logging.loggers.app.channel.class = FileChannel
logging.loggers.app.channel.pattern = %Y-%m-%d %H:%M:%S [%P - %I] [%p] %t
logging.loggers.app.channel.path = /var/log/ooklaserver.log
logging.loggers.app.level = information
Set correct permissions and restart the speedtest service
touch /var/log/ooklaserver.log
chgrp speedtest /var/log/ooklaserver.log
chmod 660 /var/log/ooklaserver.log
systemctl restart ooklaspeedtest.service
Create a new logrotate config
bash -c "cat > /etc/logrotate.d/ooklaserver" <<EOF
/var/log/ooklaserver.log {
daily
rotate 14
compress
delaycompress
create 660 root speedtest
}
EOF
Restart logrotate
systemctl restart logrotate.service
There are several features/options that can only be changed by submitting a ticket. These include (but are not limited to):
No additional server setup is required.
Install the client CLI utility here.