Getting started

CakeDB has two main dependencies:

  1. Erlang
  2. Rebar

Getting and installing Erlang

Erlang can be downloaded from the Erlang Website. If you’re using Linux, I’d recommend building it from source rather than using your distributions package manager as they tend to do weird things with it.

wget http://www.erlang.org/download/otp_src_R16B02.tar.gz
tar -zxvf otp_src_R16B02.tar.gz
cd otp_src_R16B02
./configure --prefix=/opt/otpr16b02
make
make install

If you see any warnings from the configure script concerning SSL, make sure you’ve installed the SSL development libraries for your platform. Otherwise you will have trouble using Rebar or accessing any service from Erlang that needs SSL. I prefer to install the OTP platform into its own directory in /opt/ but of course you can install it where ever you like.

You will need to add Erlang to your PATH though by doing:

export PATH=/opt/otpr16b02/bin/:$PATH

This will only last for your current session so you might want to add it to your .bashrc file. All being well you should be able to run Erlang:

Getting and installing Rebar

Some Erlang applications included a rebar script with the application itself but from what I’ve been told that’s not considered best practice (although it seems like lots of people disagree with that). Downloading and installing Rebar is easy though; you just need Erlang and git installed.

git clone https://github.com/basho/rebar.git
cd rebar
make
cp rebar /opt/otpr16b02/bin/

These are the only two things you need to build, install and run CakeDB.

Getting and installing CakeDB

git clone https://github.com/cakedb/cakedb.git
cd cakedb
rebar get-deps
rebar compile
rebar generate

This will create a directory called cake inside the rel directory. This is your built and packaged release of CakeDB. You can copy that directory anywhere you wish. To actually start CakeDB, just do:

cd cake
./bin/cake start

And you should be up and running :)