Cloud Computing, DevOps

2 Mins Read

Setting Up Nexus Repository Manager on Ubuntu 20.04 with External Storage

Voiced by Amazon Polly

Introduction

In this tutorial, we will guide you through installing and configuring the Nexus Repository Manager on Ubuntu 20.04. However, we’ll take a step further by optimizing the storage setup. Rather than utilizing the root volume for Nexus, we’ll demonstrate how to mount an external volume to a specific path, enhancing flexibility and scalability.

Pioneers in Cloud Consulting & Migration Services

  • Reduced infrastructural costs
  • Accelerated application deployment
Get Started

Prerequisites

Before diving into the installation, ensure the following prerequisites are met:

  1. A server running Ubuntu 20.04.
  2. A root password is configured for the server.

Step-by-Step Guide

To begin, update your system packages to the latest version using the following command:

Install Java:

As Nexus is based on Java, install Java version 8 on your system:

Verify the installed Java version:

Install Nexus:

To create a separate user for Nexus:

Grant the necessary privileges to the Nexus user:

Create a directory for Nexus and download the latest version:

Edit the nexus.vmoptions configuration file:

Set Java max memory size and replace “../sonatype-work” with “./sonatype-work”:

Save and close the file. Edit the nexus.rc file to define the run-as user:

Uncomment and change the following line with the Nexus user:

Save and close the file. Start the Nexus service:

Verify Nexus:

Nexus should be running and listening on port 8081. Stop the Nexus service:

Create a systemd service file to manage the Nexus service:

Add the following lines:

Reload the systemd daemon:

Start and enable the Nexus service:

Verify the status of the Nexus service:

Configure Nginx as a Reverse Proxy for Nexus:

Install Nginx and create a virtual host configuration file:

nano /etc/nginx/conf.d/nexus.conf

Add the following lines:

Verify the Nginx configuration:

Restart Nginx to apply the changes:

Verify the status of Nginx:

Mount External Storage for Nexus:

Now, let’s enhance Nexus storage by mounting an external volume. Assume the external storage device is /dev/sdb. First, partition and format the disk:

Create a mount point and mount the external volume:

Update the /etc/fstab file to ensure the volume is mounted on system reboot:

Update the Nexus data directory to use the mounted volume:

Change the line related to the Nexus data directory to:

Save and close the file. Start the Nexus service:

Verify Nexus status:

Access Nexus Web Interface:

Retrieve the Nexus admin password:

Access the Nexus web UI using your browser and the configured URL. Sign in with the admin username and the obtained password. Complete the setup wizard, configure anonymous access, and finish the setup.

Conclusion

You have successfully installed and configured Nexus Repository Manager on Ubuntu 20.04 while optimizing storage by mounting an external volume. This setup enhances flexibility and scalability for managing your software artifacts.

Drop a query if you have any questions regarding Nexus Repository Manager and we will get back to you quickly.

Making IT Networks Enterprise-ready – Cloud Management Services

  • Accelerated cloud migration
  • End-to-end view of the cloud environment
Get Started

About CloudThat

CloudThat is an award-winning company and the first in India to offer cloud training and consulting services worldwide. As a Microsoft Solutions Partner, AWS Advanced Tier Training Partner, and Google Cloud Platform Partner, CloudThat has empowered over 850,000 professionals through 600+ cloud certifications winning global recognition for its training excellence including 20 MCT Trainers in Microsoft’s Global Top 100 and an impressive 12 awards in the last 8 years. CloudThat specializes in Cloud Migration, Data Platforms, DevOps, IoT, and cutting-edge technologies like Gen AI & AI/ML. It has delivered over 500 consulting projects for 250+ organizations in 30+ countries as it continues to empower professionals and enterprises to thrive in the digital-first world.

FAQs

1. Why is it beneficial to mount external storage for Nexus Repository Manager?

ANS: – Mounting external storage for Nexus provides several benefits. It allows for better scalability, as the external volume can be easily expanded without modifying the root volume. It also facilitates data management, enabling you to separate Nexus data from the system disk, which is especially crucial for systems with limited root volume space. Additionally, using external storage simplifies backups and data migration processes.

2. What steps are involved in securing the Nexus Repository Manager setup with HTTPS when using Nginx as a reverse proxy?

ANS: – Securing Nexus with HTTPS involves configuring Nginx to handle SSL/TLS termination. First, obtain an SSL certificate from a trusted certificate authority. Next, update the Nginx virtual host configuration file (e.g., nexus.conf) to include SSL directives, specifying the path to the certificate and private key. Configure Nginx to listen on port 443, the default port for HTTPS. Finally, restart the Nginx service to apply the changes. This ensures that data exchanged between clients and Nexus is encrypted, enhancing the overall security of the Nexus web interface.

WRITTEN BY Deepak S

Deepak S works as a Research Intern at CloudThat. His expertise lies in AWS's services. Deepak is good at haunting new technologies and automobile enthusiasts.

Share

Comments

    Click to Comment

Get The Most Out Of Us

Our support doesn't end here. We have monthly newsletters, study guides, practice questions, and more to assist you in upgrading your cloud career. Subscribe to get them all!