Skip to content

02. Installation

Matthias Vandermaesen edited this page Mar 19, 2019 · 1 revision

Before installation

The Datahub is a database driven, web based application and requires that you have a web server and a database server.

For 'local' or 'online' Linux based servers, the software that is needed to run the Datahub is known as an "AMP" stack, although Microsoft based servers are also known as a stack.

AMP stack stands for

An online web host provides these technologies as part of their service, or you can install them for free on your Linux, MAC, or Windows computer.

System requirements

The Datahub is build with the PHP based web framework Symfony. Records are stored in a separate database managed by the MongoDB database system. What do you exactly need to run the software?

Disk space

A Datahub installation doesn't take a fixed amount of disk space. The core files of the code typically take around 100 MB on your server. You will need extra space for your database, log files and backups though, assuming those reside on the same file system.

Web server

Symfony based applications can be served using different web server products. Here's a list of the most widely used options:

PHP

The Datahub requires PHP 7.0 or a higher version. You wil also need these extra PHP extensions:

  • php-cli, php-intl, php-mbstring and php-mcrypt
  • The PECL Mongodb (PHP7) extension. Note that the mongodb extension must be version 1.2.0 or higher. Notably, the package included in Ubuntu 16.04 (php-mongodb) is only at 1.1.5.

Composer

Symfony based applications are managed using Composer. This is a dependency management tool for PHP. You will need it to download third party packages during installation. Future updates and upgrades are also managed through Composer.

MongoDB

The Datahub requires MongoDB 3.2.10 or a higher version.

Step 1: Get the code

The most straightforward way of getting the code is downloading the latest release as a ZIP or TAR ball from Github.

Alternatively, you can download the code from Packagist with Composer:

foo@bar:~$ composer require foo/bar

Or (fork and) clone the Git repository from Github, if you intend to actively contribute to the codebase through development.

foo@bar:~$ git clone https://github.com/thedatahub/Datahub.git datahub`

Step 2: Create a database

You will also need a MongoDB database. Make sure you have a running MongoDB database server. Log in into the Mongo Shell as a database administrator and execute these commands:

> use datahub
> db.createUser(
   {
     user: "datahub",
     pwd: "password",
     roles: [ "readWrite", "dbAdmin" ]
   }
)

Step 3: Install dependencies with Composer

The Datahub application depends on a series of third party code libraries that need to be downloaded. Go into the directory where you downloaded the core files, and execute this command:

foo@bar:~$ composer install

This will download all the necessary dependencies and store them in a directory called vendor.

Step 4: Configure your installation

During installation, you will be asked to provide a set of configuration settings. This includes the details of the connection to your MongoDB database.

  • The connection to your MongoDB instance (i.e. mongodb://127.0.0.1:27017)
  • The username of the user (i.e. datahub)
  • The password of the user (i.e. password)
  • The database where your data will persist (i.e. datahub)

Your settings will be stored in a file called app/config/parameters.yml.

Step 5: Up and running

Complete the installation by executing these commands which will setup the application.

foo@bar:~$ app/console app:setup

PHP comes with its own web server. This is suitable to just test the application without going through the setup of a fully fledged web server. Execute the next command to start the server:

foo@bar:~$ app/console server:run

Visit http://127.0.0.1:8000. You should be greeted by the first time installer which will ask you to register an "administrator" user. This user will be able to control all aspects and content in the entire installation.

Installation in a Production environment.

The Datahub is build using the Symfony framework. Refer to the 'How to deploy your application' section of the Symfony documentation to perform an installation in a fully fledged production environment.