How to Install Apache Solr on Ubuntu 16.04

  1. Supports different file formats like XML, JSON and .CSV.
  2. Can be deployed in any kind of systems such as standalone, distributed, and cloud.
  3. Allows customization of components easily.
  4. Provides a user-friendly, and feature powered web interface that can be used to manage logs, add, delete, update and search documents.
  5. Provides advanced text search capabilities including phrases, wildcards, joins, grouping and much more across any data type.


  1. A fresh Alibaba cloud instance with Ubuntu 16.04 server installed.
  2. A static IP address is configured on the instance.
  3. A root password is setup on the server.

Launch an Alibaba Cloud ECS Instance

First, login to your Alibaba Cloud ECS Console. Create a new ECS instance, with Ubuntu 16.04 as the operating system with at least 2GB RAM. Connect to your ECS instance and log in as the root user.

apt-get update -y

Install Java

By default, the latest version of the Java is not available in Ubuntu 16.04 default repository. So, you will need to add the Java repository to your system. You can add Java repository using the following command:

apt-get install python-software-properties -y
add-apt-repository ppa:webupd8team/java
apt-get update -y
apt-get install oracle-java8-installer -y
java -version
java version "1.8.0_161"
Java(TM) SE Runtime Environment (build 1.8.0_161-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode)

Install Apache Solr

First, you will need to download the latest version of the Solr from their official website. You can do this using the following command:

cd /opt/
tar xzf solr-7.3.1.tgz solr-7.3.1/bin/ --strip-components=2
./ solr-7.3.1.tgz
Service solr installed.
Customize Solr startup configuration in /etc/default/
● solr.service - LSB: Controls Apache Solr as a Service
Loaded: loaded (/etc/init.d/solr; bad; vendor preset: enabled)
Active: active (exited) since Sun 2018-05-20 07:37:04 IST; 5s ago
Docs: man:systemd-sysv-generator(8)
service solr status
solr.service - LSB: Controls Apache Solr as a Service
Loaded: loaded (/etc/init.d/solr; bad; vendor preset: enabled)
Active: activating (start) since Thu 2018-05-24 21:22:20 IST; 49s ago
Docs: man:systemd-sysv-generator(8)
└─569 /bin/sh /etc/init.d/solr start

Create Your First Solr Collection

Now, create your first collection in Apache Solr by running the following command:

cd /opt
solr -c "/opt/solr/bin/solr create -c letsstarted -n data_driven_schema_configs"
Created new core 'letsstarted'

Access Solr Web Interface

Apache Solr is now up and running on port 8983. Open your web browser and type the URL, and you should see the following page:

"id": 1,
"book_title": "Linux Cookbook",
"published": 2018,
"description": "All about Linux"
Status: success
"status": 0,
"QTime": 1611

Related Alibaba Cloud Products

Alibaba Cloud CDN is built to automatically handle spikes in traffic, reduce load speed on your origin site and support storage capacity of up to 1.5 petabytes.
With its low latency and high data transfer rate, the Alibaba Cloud CDN directs user requests to the most suitable node based on network congestion to retrieve content in the most efficient manner. The CDN has a high performance cache system built with powerful clusters of servers to maximize throughput. The CDN relies on an intelligent object heat algorithm and hierarchical ‘hot’ cache resources for precise resource acceleration.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Alibaba Cloud

Alibaba Cloud

Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website: