Love your Linux server but wish you had more information about how it runs throughout the day? If so, Linux Dash may be just what you need! It’s a neat tool that, once installed, gives users a Linux server dashboard that allows users to view real-time information about RAM load, CPU usage, Network traffic and even Docker!
SPOILER ALERT: Scroll down and watch the video tutorial at the end of this article.
Install Linux Dash
The Linux Dash dashboard software makes use of a lot of different web technologies, like NodeJS, Go, Python and others. The dashboard can run with any of these technologies as a host. However, in this guide, we’ll focus on NodeJS, as it’s consistently the easiest to use. If you’d like to set up Linux Dash to run on something else, aside from Node, check the link here for instructions.
Getting the software working is a snap, as users do not need to fiddle with a downloadable package for Linux Dash. This makes the dashboard software great, as no matter what Linux server OS you have, it’ll run. To start the installation, open up a terminal and get NodeJS working on your Linux server.
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - sudo apt install nodejs git
or, for Debian:
sudo apt-get install nodejs git
curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -
sudo yum install nodejs npm git
or, for Suse systems, do:
sudo zypper install nodejs npm git
NodeJS is working on the server, so now it’s time to get a Linux Dash setup going. Using the Git tool, clone the latest version of the code.
sudo -s cd /opt/
git clone --depth 1 https://github.com/afaqurk/linux-dash.git
Linux Dash is a web application at its core, so cloning the code down from Github is quite fast. When the cloning process is complete, use the CD command to move the terminal into the code directory.
Alternatively, if you’re not a fan of Git, you can use Curl to download the code to the server.
Note: only use this method if you can’t install the Git tool.
sudo -s cd /opt
curl -LOk https://github.com/afaqurk/linux-dash/archive/master.zip unzip master.zip rm master.zip
As we are using NodeJS for the basis of Linux Dash, we’ll need to use it to install the software. In the server folder, use the npm command to install Linux Dash to your system.
sudo npm install --production
NPM is the NodeJS packaging tool. Let it install the software. When the installation is complete, use the node command to start Linux Dash.
node index.js --port 8080
To access the Linux Dash dashboard, open up a web browser and visit the following website address:
Linux Dash In tBackground
Linux Dash is brilliant, and with it, users are able to get a lot of important information about their systems. However, as it’s a web application without a traditional DEB or RPM package, there’s no process for running it in the background. This means that any time you’d like to see your information, you’ll have to SSH into the server, and run a Node, Go or Python command to check.
Thankfully, with a little Bash knowledge, it’s easy to offload Linux Dash into the background. Better yet, there’s no need to mess with systemd, or the init system! To start this process, open up a terminal, log into the server over SSH and use the touch command to create a new blank file.
ssh server-ip-address sudo -s touch linux-dash-startup
Using the echo command, add a Shebang to the script, so that the Linux server knows what to do with the script.
echo '#!/bin/bash' >> linux-dash-startup
Add a space, using echo, to make room for the code.
echo ' ' >> linux-dash-startup echo ' ' >> linux-dash-startup
Put a line of code in the script that will tell the system where Linux Dash is on your Linux server.
echo 'cd /opt/linux-dash/app/server' >> linux-dash-startup echo ' ' >> linux-dash-startup
Run echo and write the execution command into the script. In this case, we’re telling NodeJS to run Linux Dash.
Note: feel free to replace “node index.js” with another command, if you chose to set Linux Dash up with something other than Node.
echo 'node index.js --port 8080 &>/dev/null &' >> linux-dash-startup
Update the permissions of the script so that it can execute as a program.
chmod +x linux-dash-startup
Move the script into /usr/bin. Placing the script file here will allow any user on the server to easily start Linux Dash like any other command.
mv linux-dash-startup /usr/bin
To run Linux Dash in the background, run the following command in a terminal on the server: