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 the Wheezy (7.x) and Jessie (8.x) distributions. To install CrateDB from our repository requires a couple of steps.

The first two steps are identical for both 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

Debian Wheezy

3. Install Java 8

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

4. Add CrateDB Repository to Sources List

Next, add the CrateDB repository to /etc/apt/sources.list.

Stable Releases
deb https://cdn.crate.io/downloads/apt/stable/ wheezy main
deb-src https://cdn.crate.io/downloads/apt/stable/ wheezy main
Testing Releases
deb https://cdn.crate.io/downloads/apt/testing/ wheezy main
deb-src https://cdn.crate.io/downloads/apt/testing/ wheezy main

5. Fetch New Sources and Install CrateDB

sudo apt-get update
sudo apt-get install crate

Verify that you have installed CrateDB and it’s running:

sudo service crate status

Debian Jessie

3. Add Backports and CrateDB Repository to Sources List

Next, add the CrateDB repository to /etc/apt/sources.list. Also add the jessie-backports repository to sources so that the Java 8 dependency can be resolved automatically.

deb http://http.debian.net/debian jessie-backports main
Stable Releases
deb-src https://cdn.crate.io/downloads/apt/stable/ jessie main
deb https://cdn.crate.io/downloads/apt/stable/ jessie main
Testing Releases
deb https://cdn.crate.io/downloads/apt/testing/ jessie main
deb-src https://cdn.crate.io/downloads/apt/testing/ jessie main

4. Fetch New Sources and Install CrateDB

sudo apt-get update
sudo apt-get install crate
sudo systemctl enable crate

Verify that you have installed CrateDB and it’s running:

sudo systemctl status crate

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 Yakkety Yak (16.10), Xenial Xerus (16.04), Trusty Tahr (14.04) and Precise Pangolin (12.04). They are available on our Launchpad page. Adding the repository and installing CrateDB requires the following commands:

Install Java 8

Ubuntu 12.04 and 14.04 do not officially ship with Java 8, so you have to install it via a 3rd party repository

Install CrateDB

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

Start CrateDB

CrateDB should have been started automatically by upstart and you can stop or restart it with:

sudo service crate stop
sudo service crate restart

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 it should be disabled on production systems. If you want to enable the Testing repo on your server. To enable the Testing Repository on your machine add the PPA:

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:crate/testing
sudo apt-get update
sudo apt-get install crate

Important: CrateDB requires the latest Java 8 (at least u20 or higher). To run CrateDB on Ubuntu releases older than 14.10 you would need to install Java 8 from the Ubuntu Backports repository.

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