Install CrateDB on Linux

Crate maintains official packages for Debian, RedHat Enterprise Linux and Ubuntu. We recommend you use our 1-step installer that will configure the appropriate package repository and install Crate for you.

bash -c "$(curl -L install.crate.io)"

If you like to do things manually, here’s how.

Debian

We provide Debian packages for Wheezy (7.x), Jessie (8.x) and Stretch (9.x). To install CrateDB from our repository requires a couple of steps.

The first three steps are identical for all distributions.

1. Install HTTPS Support for Apt

sudo apt-get install apt-transport-https

2. Download and Install GPG Key

wget https://cdn.crate.io/downloads/apt/DEB-GPG-KEY-crate
sudo apt-key add DEB-GPG-KEY-crate

3. Add APT repository to sources list

Next, add a file for the CrateDB repository in /etc/apt/sources.list.d/ and name it for example crate-testing.list (for testing repository) or crate-stable.list (for stable repository).

Add the following contents to the file and replace <codename> with the actual codename of your distribution (wheezy, jessie, or stretch).

Stable Releases

deb https://cdn.crate.io/downloads/apt/stable/ <codename> main
deb-src https://cdn.crate.io/downloads/apt/stable/ <codename> main

Testing Releases

deb https://cdn.crate.io/downloads/apt/testing/ <codename> main
deb-src https://cdn.crate.io/downloads/apt/testing/ <codename> main

4. Additional Requirements

Debian Wheezy

Wheezy does not officially ship with Java 8, so you have to install it via a 3rd party repository, e.g. provided by webupd8team:

echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | sudo tee -a /etc/apt/sources.list
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | sudo tee -a /etc/apt/sources.list
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886
sudo apt-get update
sudo apt-get install oracle-java8-installer

Debian Jessie

Jessie provides Java 8 via the backports repository. If you haven’t added it yet, you can do so by adding the following line to the /etc/apt/sources.list file:

deb http://http.debian.net/debian jessie-backports main

Debian Stretch

There are no additional requirements.

5. Fetch New Sources and Install CrateDB

sudo apt-get update
sudo apt-get install crate

After the installation is finished, the crate service should be running.

Red Hat

The CrateDB Team maintains the official YUM repositories for RPM-based releases, supporting Linux Distributions such as RedHat Enterprise Linux 6, CentOS 6 and Scientific Linux 6.

RHEL6

Enable the CrateDB YUM Repository

All CrateDB packages are signed with GPG. To verify packages, you must install the public key and then install the .rpm containing the YUM repository definition.

sudo rpm --import https://cdn.crate.io/downloads/yum/RPM-GPG-KEY-crate
sudo rpm -Uvh https://cdn.crate.io/downloads/yum/6/x86_64/crate-release-6.5-1.noarch.rpm
Testing and Unstable Releases

The CrateDB Testing repository is disabled by default, it contains development builds and is frequently updated. The packages are waiting for feedback from testers on functionality and stability. Packages in this repository will change during development, so you should disable it on production systems. If you want to enable the Testing repo on your server, set enabled=1 in /etc/yum.repos.d/crate.repo.

Install CrateDB

yum install crate

Start CrateDB

sudo service crate start

RHEL7

The CrateDB Team maintains the official YUM repositories for RPM-based releases. It’s supported on Linux Distributions such as RedHat Enterprise Linux 7, CentOS 7, or Scientific Linux 7.

Enable the CrateDB YUM Repository

All CrateDB packages are signed with GPG. To verify packages, you must install the public key and then you can install the .rpm containing the YUM repository definition.

sudo rpm --import https://cdn.crate.io/downloads/yum/RPM-GPG-KEY-crate
sudo rpm -Uvh https://cdn.crate.io/downloads/yum/7/noarch/crate-release-7.0-1.noarch.rpm

Install CrateDB

sudo yum install crate

Start CrateDB

sudo systemctl start crate.service

Ubuntu

We build packages for the Ubuntu versions Zesty Zapus (17.04), Yakkety Yak (16.10), Xenial Xerus (16.04), and Trusty Tahr (14.04). CrateDB versions prior to 2.1.0 are available on our Launchpad page. Adding the repository and installing CrateDB requires the following commands.

Notes on Java 8 on Ubuntu

CrateDB requires Java 8u20 or higher. To run Crate on Ubuntu releases older than 14.10 you will need to install Java 8 manually. Ubuntu 14.04 does not provide Java 8 in any of their official repos, so you have to install it via a 3rd party repository

Install CrateDB From PPA

Note

The Crate PPA on Launchpad is deprecated and only contains CrateDB versions prior to and including 2.0.x. Please read Install CrateDB from DEB repository for instructions how to install CrateDB >= 2.1.0 from our CrateDB Ubuntu repository.

Adding a PPA repository requires python-software-properties to be installed:

sudo apt-get install python-software-properties

Ubuntu >= 16.x additionally requires software-properties-common:

sudo apt-get install software-properties-common

Then it’s possible to add the CrateDB repository using add-apt-repository and install CrateDB:

sudo add-apt-repository ppa:crate/stable
sudo apt-get update
sudo apt-get install crate

If you want to install testing releases, you can simply replace ppa:crate/stable with ppa:crate/testing and run apt-get update again.

Install CrateDB from DEB repository

Note

This repository contains only CrateDB versions greater than and equal to 2.1.0.

First, you need to download and install the GPG key with which the packages are verified.

wget https://cdn.crate.io/downloads/deb/DEB-GPG-KEY-crate
sudo apt-key add DEB-GPG-KEY-crate

Then add the testing or stable repo to your apt sources by adding a new file in the /etc/apt/sources.list.d/ directory with the following content:

deb https://cdn.crate.io/downloads/deb/<repo>/ <codename> main
deb-src https://cdn.crate.io/downloads/deb/<repo>/ <codename> main

Replace <repo> with testing or stable depending which repo you want to use, and replace codename with the code name of your Ubuntu distribution. Use source /etc/os-release && echo $UBUNTU_CODENAME if you don’t know the code name of your distro.

Start CrateDB

CrateDB should have been started automatically. You can stop or restart the crate service with upstart or systemd.

# with upstart/sysvinit
sudo service crate stop
sudo service crate restart
# with systemd
sudo systemctl stop crate
sudo systemctl restart crate

Testing Releases

The CrateDB testing repositories contain releases that have not been declared as stable. They are usually more frequently updated than the stable repos. Packages in the testing repos are still waiting for feedback from testers on functionality and stability, so they should not be used on production systems.

Setting Environment Variables

On Ubuntu, Debian and RHEL systems the CrateDB startup script sources environment variables, such as CRATE_HEAP_SIZE or CRATE_JAVA_OPTS that you define in /etc/default/crate.

Example

# Heap Size (defaults to 256m min, 1g max)
CRATE_HEAP_SIZE=2g

# Maximum number of open files, defaults to 65535.
# MAX_OPEN_FILES=65535

# Maximum locked memory size. Set to "unlimited" if you use the
# bootstrap.mlockall option in crate.yml. You must also set
# CRATE_HEAP_SIZE.
MAX_LOCKED_MEMORY=unlimited

# Additional Java OPTS
# CRATE_JAVA_OPTS=

# Force the JVM to use IPv4 stack
CRATE_USE_IPV4=true

Next Steps