Freeboard.io: installation on Ubuntu 16.04 with Apache2

Freeboard.io is an Open Pource project that creates interfaces for displaying data from connected objects or performing actions (lighting lamps, driving relays …). Frebboard.io is directly accessible from the internet but the free offer does not allow to own a private dashboard. In this tutorial, we will install Freeboard.io on a mini PC running Ubuntu 16.04 LTS by running it with an Apache 2 web server.

Installing Apache 2

Apache 2 installs very easily with the apt-get command.

sudo apt-get update
sudo apt-get install apache2

Accept questions asked during installation. At the end of the installation, the Apache Web server starts automatically.

Installing Freeboard.io on Ubuntu

Get sources from GitHub

Let’s start by installing git.

Sudo apt-get install git

An installation directory is created. It does not matter the location of the directory, install it for example in your user folder or in the Home.

Sudo mkdir /home/freeboard_io

We start download sources from GitHub

cd /home/freeboard_io
git clone https://github.com/Freeboard/freeboard.git

Creating a symbolic link to /var/www

The files of the website must be located (ideally by convention) in the folder /var/www. We will simply create a symbolic link that will allow the Apache server to find its children.

sudo -s
cd /var/www
ln -s /home/freeboard_io/freeboard freeboard_io

Configuring Freeboard_io for Apache

Now, you need to configure a new freeboard_io.com site to work with the Apache server. We start by creating a new site in the sites-availables folder.

sudo nano /etc/apache2/sites-available/freeboard_io.conf

Adapt the configuration to your needs and paste it into the configuration file

<VirtualHost *:80>
    ServerAdmin admin@freeboard_io.com
    ServerName freeboard_io.com
    ServerAlias www.freeboard_io.com
    DocumentRoot /var/www/iot
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Save the configuration file with Ctrl + X and then O.

Now we make the site active with the command a2ensite

cd /etc/apache2/sites-available
sudo a2ensite freeboard_io.conf

In fact, the a2ensite command creates a symbolic link to the sites-enable directory.

It only remains to restart the Apache service to take into account the new modification.

sudo service apache2 restart

Configuring the Hosts File

It only remains to point the url to the site. To do this, retrieve the ip address of your machine with the ifconfig command and then open the /etc/hosts  file.

sudo nano /etc/hosts

Replace the IP address with that of your machine then save with CTRL+X then Y.

127.0.0.1       localhost
192.168.2.2     freeboard_io.com

And now you can access freeboard from your browser using the address http://freeboard_io.com

freeboard ubuntu apache2 nginx

In the next tutorial, we’ll see how to run Freeboard.io with Nginx.

Useful links :

Subscribe to the weekly newsletter

No spam and no other use will be made of your email. You can unsubscribe anytime.

1 Comment
  1. I Can’t get it to work
    In the .conf file documentroot /var/www/iot
    is this correct and do I need to create it
    Regards Struggling Newbe

Leave a Reply

DIY Projects
%d bloggers like this: