Repository Management with Nexus
3.3. Installing Nexus
The following instructions are for installing Nexus Open Source or Nexus Professional as a stand-alone server. Nexus comes bundled with a Jetty instance which listens to all configured IP addresses on a host (0.0.0.0) and runs on port 8081 by default. If you would like to run Nexus as a web application in an existing application server or servlet container, please refer to the instructions in Section 3.9, “Installing the Nexus WAR”.
Installing Nexus is straightforward. Unpack the Nexus web application archive in a directory. If you are installing Nexus on a local workstation to give it a test run, you can install it in your home directory or wherever you like; Nexus doesn’t have any hard coded directories, it will run from any directory. If you downloaded the ZIP
$ unzip nexus-2.2-01-bundle.zip
And, if you download the GZip’d TAR archive, run:
$ tar xvzf nexus-2.2-01-bundle.tar.gz
For Nexus professional the equivalent commands would be
$ unzip nexus-professional-2.2.1-bundle.zip $ tar xvzf nexus-professional-2.2.1-bundle.tar.gz
There are some known incompatibilities with the version of tar provided by Solaris and the gzip tar format. If you are installing Nexus on Solaris, you must use the GNU tar application, or you will end up with corrupted files.
If you are installing Nexus on a server, you might want to use a directory other than your home directory. On a Unix machine, this book assumes that Nexus is installed in /usr/local/nexus-2.2.1 with a symbolic link /usr/local/nexus to the nexus directory. Using a generic symbolic link nexus to a specific version is a common practice which makes it easier to upgrade when a newer version of Nexus is made available.
$ sudo cp nexus-2.2-01-bundle.tar.gz /usr/local $ cd /usr/local $ sudo tar xvzf nexus-2.2-01-bundle.tar.gz $ ln -s nexus-2.2-01 nexus
Although it isn’t required for Nexus to run, you may want to set an environment variable NEXUS_HOME in your environment which points to the installation directory of Nexus. This chapter will refer to this location as $NEXUS_HOME
On Windows you should install Nexus outside Program Files to avoid problems with Windows file registry virtualization. If you plan to run Nexus as a specific user you could install into the AppData/Local directory of that users home directory. Otherwise simply go with e.g. C:\nexus or something similar.
The Nexus installation directory nexus-2.2-01 or nexus-professional-2.2.1 has a sibling directory named sonatype-work. This directory contains all of the repository and configuration data for Nexus and is stored outside of the Nexus installation directory to make it easier to upgrade to a newer version of Nexus.
By default, this directory is always a sibling to the nexus installation directory; if you installed nexus in the /usr/local directory it would also contain a sonatype-work sub-directory with a nested nexus directory containing all of the content and configuration. The location of the sonatype-work directory can be customized by altering the nexus-work property in $NEXUS_HOME/conf/nexus.properties