Installing Elasticsearch on Laravel Homestead

3rd August 2014

Here's a gist I created, showing how to install Elasticsearch on a Laravel Homestead box with just a few lines. Hope you find it useful.

# Install Java
sudo apt-get install openjdk-7-jre-headless -y
# Download & install the Public Signing Key
wget -qO - http://packages.elasticsearch.org/GPG-KEY-elasticsearch | sudo apt-key add -
# Add the following to /etc/apt/sources.list
deb http://packages.elasticsearch.org/elasticsearch/1.3/debian stable main
# Update Aptitude
sudo apt-get update
# Install Elasticsearch
sudo apt-get install elasticsearch
# Configure Elasticsearch to run on startup
sudo update-rc.d elasticsearch defaults 95 10
# Start the server now
sudo /etc/init.d/elasticsearch start
# Test whether it's working
curl -X GET localhost:9200