You can very easily install Electric Brain using a single command. Simply paste this into command into a terminal:

curl -fsSL https://raw.githubusercontent.com/electricbrainio/electric-brain/master/setup/install.sh | bash

You will be prompted a few times to provide your password during the installation.

Operation

The Electric Brain infrastructure is divided into two components, the API and frontend application server, and backend workers which do processing. Both of them are required for Electric Brain to function properly, and they both require connections to RabbitMQ and MongoDB. You can have as many of each running as you want.

To run the API server, simply run:

apples-Mac-mini:~ user$ ebapi

To run the worker, simply run:

apples-Mac-mini:~ user$ ebworker

You can also run an all-in-one application server using:

apples-Mac-mini:~ user$ ebapplication

The manual installation goes through each of the steps required to install Electric Brain.

Dependencies

Electric Brain has several major dependencies:

  1. NodeJS >= 4.2.6
  2. MongoDB >= 2.6
  3. RabbitMQ
  4. Torch
  5. Sqlite3
  6. Graphviz

On macOS/OSX, you can install all of the required tools by using Home Brew.

Install Home Brew

The first step is to install Home Brew. HomeBrew is a package manager. You can view the installation on their website, https://brew.sh/. It boils down to a single command:

apples-Mac-mini:~ user$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Install Dependencies

Now you can use HomeBrew to install the major dependencies of Electric Brain.

apples-Mac-mini:~ user$ brew install mongodb
apples-Mac-mini:~ user$ brew install rabbitmq
apples-Mac-mini:~ user$ brew install node@4
apples-Mac-mini:~ user$ brew install graphviz
apples-Mac-mini:~ user$ brew install sqlite
apples-Mac-mini:~ user$ brew services start mongodb apples-Mac-mini:~ user$ brew services start rabbitmq

Torch must be installed separately. There are no easily available macOS packages for Torch, because of its nature as an academic tool. The easiest way to install it is to follow their Getting Started Guide here: http://torch.ch/docs/getting-started.htmlThere is one modification that we recommend, which is to set your environment variable PREFIX to “/usr/local” prior to running the commands. The complete commands for installing Torch on macOS are, thus:

apples-Mac-mini:~ user$ export PREFIX=/usr/local
apples-Mac-mini:~ user$ git clone https://github.com/torch/distro.git ~/torch --recursive
apples-Mac-mini:~ user$ cd ~/torch; bash install-deps;
apples-Mac-mini:~ user$ sudo PREFIX=/usr/local ./install.sh

After installing Torch, you will need to manually instal several Electric Brain dependencies in Lua via luarocks:

apples-Mac-mini:~ user$ sudo luarocks install json
apples-Mac-mini:~ user$ sudo luarocks install distlearn
apples-Mac-mini:~ user$ sudo luarocks install ipc
apples-Mac-mini:~ user$ sudo luarocks install rnn
apples-Mac-mini:~ user$ sudo luarocks install underscore
apples-Mac-mini:~ user$ sudo luarocks install luasocket
apples-Mac-mini:~ user$ sudo luarocks install lsqlite3

Now you can finally install Electric Brain via NPM. It must be installed globally using the -g command.

apples-Mac-mini:~ user$ sudo npm install electricbrain -g

You can easily install Electric Brain using the following one-line command:

curl -fsSL https://raw.githubusercontent.com/electricbrainio/electric-brain/master/setup/install.sh | sudo bash

You may be prompted to provide your password for the installation.

Operation

The Electric Brain infrastructure is divided into two components, the API and frontend application server, and backend workers which do processing. Both of them are required for Electric Brain to function properly, and they both require connections to RabbitMQ and MongoDB. You can have as many of each running as you want.

To run the API server, simply run:

ebapi

To run the worker, simply run:

ebworker

You can also run an all-in-one application server using:

ebapplication

Manual installation goes through each of the steps required to install Electric Brain separately.

Dependencies

Electric Brain has several major dependencies:

  1. NodeJS >= 4.2.6
  2. MongoDB >= 2.6
  3. RabbitMQ
  4. Torch
  5. Sqlite3
  6. Graphviz

On Red Hat / Fedora, we must first install the RedHat Extra Packages Repository (see https://fedoraproject.org/wiki/EPEL):

rpm -Uvh --replacepkgs https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

Now you can install several of the dependencies easily using yum:

sudo yum install mongodb mongodb-server nodejs git graphviz gcc-c++ sqlite3-devel
sudo service mongod start

RabbitMQ is best installed using the official packages:

yum install -y erlang
wget https://github.com/rabbitmq/rabbitmq-server/releases/download/rabbitmq_v3_6_6/rabbitmq-server-3.6.6-1.el7.noarch.rpm
rpm --import https://www.rabbitmq.com/rabbitmq-signing-key-public.asc
rpm -Uvh --replacepkgs rabbitmq-server-3.6.6-1.el7.noarch.rpm
sudo service rabbitmq-server start

Torch must be installed separately. There are no easily available Red Hat packages for Torch, because of its nature as an academic tool. The easiest way to install it is to follow their Getting Started Guide here: http://torch.ch/docs/getting-started.html

There is one modification that we recommend, which is to set your environment variable PREFIX to “/usr/local” prior to running the commands. The complete commands for installing Torch on Fedora 25 are, thus:

export PREFIX=/usr/local
git clone https://github.com/torch/distro.git ~/torch --recursive
cd ~/torch; bash install-deps;
sudo PREFIX=/usr/local ./install.sh

After installing Torch, you will need to manually instal several Electric Brain dependencies in Lua via luarocks:

sudo /usr/local/bin/luarocks install json
sudo /usr/local/bin/luarocks install distlearn
sudo /usr/local/bin/luarocks install ipc
sudo /usr/local/bin/luarocks install rnn
sudo /usr/local/bin/luarocks install underscore
sudo /usr/local/bin/luarocks install luasocket
sudo /usr/local/bin/luarocks install lsqlite3

Now you can finally install Electric Brain via NPM. It must be installed globally using the -g command.

sudo npm install electricbrain -g

You can easily install Electric Brain using the following one-line command:

curl -fsSL https://raw.githubusercontent.com/electricbrainio/electric-brain/master/setup/install.sh | sudo bash

You may be required to provide your password for the installation.

Operation

The Electric Brain infrastructure is divided into two components, the API and frontend application server, and backend workers which do processing. Both of them are required for Electric Brain to function properly, and they both require connections to RabbitMQ and MongoDB. You can have as many of each running as you want.

To run the API server, simply run:

ebapi

To run the worker, simply run:

ebworker

You can also run an all-in-one application server using:

ebapplication

Here we will go through all of the installation steps one by one.

Dependencies

Electric Brain has several major dependencies:

  1. NodeJS >= 4.2.6
  2. MongoDB >= 2.6
  3. RabbitMQ
  4. Torch
  5. Sqlite3
  6. Graphviz

On Ubuntu 16.04, several of the required tools can be installed with their required versions very easily from the mainline package repository.

sudo apt install mongodb rabbitmq-server graphviz git build-essential libsqlite3-dev -y

NodeJS is best installed from the NodeSource repository, to ensure you get a compatible version.

curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get update
sudo apt-get install nodejs -y

Torch must be installed separately. There are no easily available Ubuntu packages for Torch, because of its nature as an academic tool. The easiest way to install it is to follow their Getting Started Guide here: http://torch.ch/docs/getting-started.html

There is one modification that we recommend, which is to set your environment variable PREFIX to “/usr/local” prior to running the commands. The complete commands for installing Torch on Ubuntu 16.04 are, thus:

export PREFIX=/usr/local
git clone https://github.com/torch/distro.git ~/torch --recursive
cd ~/torch; bash install-deps;
sudo PREFIX=/usr/local ./install.sh -b

After installing Torch, you will need to manually install several Electric Brain dependencies in Lua via luarocks:

sudo luarocks install json
sudo luarocks install distlearn
sudo luarocks install ipc
sudo luarocks install rnn
sudo luarocks install underscore
sudo luarocks install luasocket
sudo luarocks install lsqlite3

Now you can finally install Electric Brain via NPM. It must be installed globally using the -g command.

sudo npm install electricbrain -g

All-In-One Docker Installation

 

Electric Brain prepares easy-to-install docker images. Our docker image contains MongoDB, RabbitMQ, and Electric Brain all wrapped into one. This means you only need to use the following command in order to be up and running with Electric Brain and Docker:
docker create -p 3891:3891 electricbrainio/electricbrain-allinone:latest
docker start <container-id>

You will then be able to access the Electric Brain user interface by going to localhost:3891/app/ in your browser.