Solr on Ubuntu, revisited

It's been a while since I first wrote about setting up Solr on Ubuntu. Since then I've opted for a different approach that is both simpler and lighter-weight. This post describes briefly the steps to setting up Solr on Ubuntu.

Fetching the code

First step is to get a copy of Solr:

cd /tmp/
tar xzf apache-solr-1.4.1.tgz


I create a "solr" user and just put the webapp and all the configuration data in that user's home directory:

# create the solr user
sudo useradd solr

# copy the solr executable and sample conf to the solr home dir
sudo cp -R apache-solr-1.4.1/example/ /home/solr/

cd /home/solr/

If you want to use a multi-core configuration, you'll need to shuffle around the default conf:

sudo mv solr/ single-core
sudo mv multicore/ solr

Lastly, change permissions:

sudo chown -R solr:solr .

Testing it out

Now you're ready to test the installation. From the /home/solr/ directory, run the following:

sudo su solr
java -jar start.jar

You should see a bunch of output with this at the end:

2011-06-17 16:39:18.320::INFO:  Started SocketConnector @

Solr's web interface is now available at:


Using a process manager to start/stop Solr

I personally like supervisord for process management. Another popular option is upstart. These tools can make it easy to automatically start Solr and are a good replacement for the more old-school "init" scripts.

Here's what my supervisor conf looks like:

command=java -Xmx128m -jar start.jar

Hope this helps!

Comments (1)

steven casey | jun 30 2011, at 01:28am

Thanks man,

This post and your previous one ( was a very helpful step-by-step guide... no thought required, just cut, paste, enter, sorted.

Commenting has been closed, but please feel free to contact me