Skip to content

Manual Installation

Henry Whitaker edited this page Nov 29, 2020 · 3 revisions

The following has been tested on a fresh installation of Ubuntu.

Installing Dependencies

This program has some dependencies, to install them you need to run the following:

sudo apt update
sudo apt install php-common php7.3 php7.3-cli php7.3-common php7.3-json php7.3-opcache php7.3-readline php-xml php-sqlite3 php-zip php-mbstring composer python3 python3-pip git
sudo apt install curl
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt install nodejs

Then, download the code by running:

git clone https://github.com/henrywhitaker3/Speedtest-Tracker.git

Now you need to download Ookla's speedtest binary for your system from here. For a x86_64 system:

wget https://bintray.com/ookla/download/download_file?file_path=ookla-speedtest-1.0.0-x86_64-linux.tgz -O speedtest.tgz
tar zxvf speedtest.tgz
mv speedtest Speedtest-Tracker/app/Bin/

Install the composer and npm dependencies:

composer install
npm install && npm run production

Setting up the database

Run the following to set your database variables:

cp .env.example .env

Then update the DB_DATABASE value with the absolute path of your install, followed by /database/speed.db.

Finally, run the following to setup the tables in the database:

php artisan key:generate
php artisan migrate

Now you need to accept Ookla's EULA by running:

php artisan speedtest:eula

Now run the following to make sure everything has been setup properly (it should output a speedtest result):

php artisan speedtest:run

Scheduling Setup

To get speed test results every hour, you need to add a cronjob, run sudo crontab -e and add an entry with the following (with the path you your install):

* * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1

Queue Setup

sudo vim /etc/systemd/system/speedtest.service

Add the following, updating the command and user values:

[Unit]
Description=Runs and keeps alive the artisan queue:work process
OnFailure=failure-notify@%n.service

[Service]
User=root
Restart=always
WorkingDirectory=/home/henry/Speedtest-Tracker
ExecStart=/usr/bin/php artisan queue:work

[Install]
WantedBy=default.target

Then run:

sudo systemctl daemon-reload
sudo systemctl enable speedtest.service
sudo systemctl start speedtest.service