How to Install Nexus repository manager on Rocky Linux

In this blog we will see how to install Nexus repository manager on Rocky Linux. A free, open-source artifact management application called Sonatype Nexus assists you in efficiently managing artifacts throughout your software supply chain. For each component, it offers a single source of truth and native package management compatibility. It is compatible with the user and authentication solutions you already have, such as Atlassian Crowd and LDAP. IDEs and continuous integration tools such as Eclipse, IntelliJ, Visual Studio, Jenkins, and others are compatible with Sonatype Nexus.

System Requirements

  • Rocky Linux 8 – refer How to Install Rocky Linux 8
  • Non root user – nexus
  • Find the RAM and CPU requirement as per the table below . For this blog I am going with “Small” profile size.
Profile SizeProfile DescriptionCPUsDisk Size (Blob)RAMHeap Memory
Small< 20 repositories< 20GB total blob store sizesingle repository format type820GB8GBMin: 2703MMax: 2703M
Medium< 50 repositories< 200GB total blob store sizea few repository formats16200GB16GBMin: 4GMax: 4G
Large< 200 repositories> 200GB total blob store sizediverse repository formats32+200GB or more32GBMin: 8GMax: 8G
Very Large200+ repositories~10TB total blob store sizediverse repository formats32+10TB or more64GBMin: 12GMax: 12G
Resource Requirement

Nexus Installation & Configuration

Installing JDK

Login to the Rocky Linux node using SSH. Make sure the system is up to date

Install the OpenJDK 1.8 package

Download Nexus and Install

Let us start with creating the directory for the nexus packages and then move into the newly created diretory

Let us download the latest nexus. You can get the latest Download Link from here.

Untar the file

Renaming the untar file

It is not recommended to operate the Nexus service with root rights as a prudent security practice. Thus, to launch the Nexus service, establish a new user called Nexus.

Changing the ownership of the nexus files and directories

Edit the Nexus configuration file to define the nexus user

Change the following lines as per below

Save the file and exit

Creating the systemd file for Nexus

To use systemctl to control Nexus, it is preferable to have a systemd entry. For instructions on adding Nexus as a systemd service, see the section below.

Create the systemd unit file

Add the following lines to the above file

Save and exit the file

Reload the systemd daemon

Restart the service after enabling it at boot time

Allowing Firewall Ports for Nexus

Using the Firewalld utility open the required firewall ports for Nexus. By default Nexus uses 8081/tcp port

sudo firewall-cmd --add-port=8081/tcp
sudo firewall-cmd --runtime-to-permanent

Accessing the Nexus Web Interface

By this point Nexus would have started and listens on port 8081. You can check it with the following command:

You may see the output something like below

Nexus’s default username is admin and the default password is stored in the /app/sonatype-work/nexus3/admin.password file. You can see the Nexus admin password with the following command:

You may see the Nexus admin password something like below :

You can Open the browser of your choice and use the URL http://your-ip-address:8081

Conclusion

In this tutorial, we explained how to install Nexus repository manager on Rocky Linux. But this blog will work fine with any other Operating system such as AlmaLinux or Oracle Linux. You can now start managing your packages across your software supply chain. For more information, visit the Nexus documentation

Leave a comment