ElasticSearch with Ubuntu

May 7, 2014 6k views
I followed the guide here on how to install elastic search. https://www.digitalocean.com/community/articles/how-to-install-elasticsearch-on-an-ubuntu-vps#tutorial-comment-submit It mentions that it's outdated though for installing the deb packages. What would be the steps needed to install elasticsearch through their repository. I wasn't entirely sure and obviously don' want to mess it up.
4 Answers
ElasticSearch now provides a Debian repository that makes it much easier to install it and keep it updated. See:


The basic install instructions are to install their key with:

wget -O - http://packages.elasticsearch.org/GPG-KEY-elasticsearch | apt-key add

Then, create a new file "/etc/apt/sources.list.d/elasticsearch.list" containing:

deb http://packages.elasticsearch.org/elasticsearch/1.0/debian stable main

Then run:

apt-get update
apt-get install elasticsearch
Thanks Andrew, where you say "to install their key with:" Do I need to replace the first command where it says

wget -O - http://packages.elasticsearch.org/GPG-KEY-elasticsearch | apt-key add


wget -O - http://packages.elasticsearch.org/ACTUAL-KEY-I-DOWNLOADED | apt-key add


If so do I need to include the initial "-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2.0.14 (GNU/Linux....... rest of key"

Like, literally copy the contents of the whole public key you can download here:


Again apologies if this is ever so simple.
Just run the command as it is. It downloads the key on its own.

The "wget" command downloads the key from the url provided. The " | " is called a pipe. It passes the results of the "wget" command to what comes after it, in this case the "apt-key add" command. Try just running:

wget -O - http://packages.elasticsearch.org/GPG-KEY-elasticsearch

You'll see that it prints to the terminal the contents of the downloaded file. So when you add the second part, those contents are "piped" to the "apt-key add" command.

I hope that's clear. You might want to check out:

by David Collazo
The redirection capabilities built into Linux provide you with a robust set of tools used to make all sorts of tasks easier to accomplish. Whether you're writing complex software or performing file management through the command line, knowing how to manipulate the different I/O streams in your environment will greatly increase your productivity.
@Andrew SB

Thanks Andrew, I seem to have it working. My Putty is showing it's connected.

Have another answer? Share your knowledge.