Installing on
Debian and Ubuntu

Riak KV can be installed on Debian or Ubuntu-based systems using a binary package or by compiling from source code.

The following steps have been tested to work with Riak KV on Debian versions 6.05 and 7.6 and Ubuntu version 14.04.

Installing with apt

For versions of Riak prior to 2.0, Riak used a self-hosted apt repository for Debian and Ubuntu packages. For versions 2.0 and later, Riak has moved those packages to the packagecloud.io hosting service. Instructions for installing via shell scripts, manual installation, Chef, and Puppet can be found in packagecloud’s installation docs.

Platform-specific pages are linked below:

Our documentation also includes instructions regarding signing keys and sources lists, which can be found in the Advanced apt Installation section below.

Advanced apt Installation

Note on Debian 7

If you wish to install Riak on Debian 7, you may need to install libc6 version 2.15 or later, which in turn requires upgrading your system to sid. Installation instructions can be found here.

Once sid has been installed, you can install libc6 with the following command:

apt-get -t sid install libc6 libc6-dev libc6-dbg

For the simplest installation process on LTS (Long-Term Support) releases, use apt-get. First, you must retrieve the signing key:

curl https://packagecloud.io/gpg.key | sudo apt-key add -

Second, you must install the apt-transport-https package in order to be able to fetch packages over HTTPS:

sudo apt-get install -y apt-transport-https

With HTTPS enabled, we recommend adding the desired Riak package to your .list file. packagecloud can autogenerate such a file on the basis of a name that you specify, e.g. a hostname, and the desired operating system and distribution. The following example script would store your hostname in the variable HOSTNAME, send that information to packagecloud to autogenerate a .list file, and then store the return value in a file called basho.list, which is stored in the /etc/apt/sources.list.d directory. This example script is specific to the Precise Ubuntu distribution:

#!/bin/bash

HOSTNAME=`hostname -f`
FILENAME=/etc/apt/sources.list.d/basho.list
OS=ubuntu
DIST=precise
PACKAGE_CLOUD_RIAK_DIR=https://packagecloud.io/install/repositories/basho/riak
curl "${PACKAGE_CLOUD_RIAK_DIR}/config_file.list?os=${OS}&dist=${DIST}&name=${HOSTNAME}" > $FILENAME

The name that you submit to packagecloud can be anything you like. The HOSTNAME used above was for example purposes. The resulting file should hold contents like the following:

# this file was generated by packagecloud.io for
# the repository at https://packagecloud.io/basho/riak

deb https://packagecloud.io/basho/riak/ubuntu/ precise main
deb-src https://packagecloud.io/basho/riak/ubuntu/ precise main

With your basho.list file populated, you can update your apt sources list:

sudo apt-get update

Now install the riak package.

sudo apt-get install riak

That should be all.

Installing From Package

If you wish to install the deb packages by hand, follow these instructions.

Installing on Non-LTS Ubuntu Releases

Typically we only package Riak for LTS releases to keep our build and testing matrix focused. In some cases, such as Ubuntu 11.04 (Natty), there are changes that affect how Riak is packaged, so we will release a separate package for that non-LTS release. In most other cases, however, if you are running a non-LTS release (such as 12.10) it is safe to follow the below instructions for the LTS release prior to your release. In the case of Ubuntu 12.10, follow the installation instructions for Ubuntu 12.04.

PAM Library Requirement for Ubuntu

One dependency that may be missing on your machine is the libpam0g-dev package used for Pluggable Authentication Module (PAM) authentication, associated with Riak security.

To install:

sudo apt-get install libpam0g-dev

SSL Library Requirement for Ubuntu

Riak currently requires libssl version 0.9.8 on some versions of Ubuntu. Starting at Ubuntu 12.04 this is no longer an issue. Before installing Riak via package on Ubuntu, install the libssl0.9.8 package. Note that this version of libssl can be safely installed alongside current/existing libssl installations.

To install the libssl version 0.9.8 package, execute the following command:

sudo apt-get install libssl0.9.8

After the libssl package installation, proceed to installing Riak from the pre-built package by executing the following commands as appropriate for the target platform:

Riak 64-bit Installation

Ubuntu Lucid Lynx (10.04)

wget http://s3.amazonaws.com/downloads.basho.com/riak/2.0/2.0.5/ubuntu/lucid/riak_2.0.5-1_amd64.deb
sudo dpkg -i riak_2.0.5-1_amd64.deb

Ubuntu Natty Narwhal (11.04)

wget http://s3.amazonaws.com/downloads.riak.com/riak/2.0/2.0.5/ubuntu/natty/riak_2.0.5-1_amd64.deb
sudo dpkg -i riak_2.0.5-1_amd64.deb

Ubuntu Precise Pangolin (12.04)

wget http://s3.amazonaws.com/downloads.riak.com/riak/2.0/2.0.5/ubuntu/precise/riak_2.0.5-1_amd64.deb
sudo dpkg -i riak_2.0.5-1_amd64.deb

Installing From Source

First, install Riak dependencies using apt:

sudo apt-get install build-essential libc6-dev-i386 git

Riak requires an Erlang installation. Instructions can be found in Installing Erlang.

wget http://s3.amazonaws.com/downloads.riak.com/riak/2.0/2.0.5/riak-2.0.5.tar.gz
tar zxvf riak-2.0.5.tar.gz
cd riak-2.0.5
make rel

If the build was successful, a fresh build of Riak will exist in the rel/riak directory.

Next Steps

Now that Riak is installed, check out Verifying a Riak Installation.