Cloud Computing, DevOps

2 Mins Read

Setting Up Nexus Repository Manager on Ubuntu 20.04 with External Storage

Voiced by Amazon Polly


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.


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.

Pioneers in Cloud Consulting & Migration Services

  • Reduced infrastructural costs
  • Accelerated application deployment
Get Started

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.


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 a leading provider of Cloud Training and Consulting services with a global presence in India, the USA, Asia, Europe, and Africa. Specializing in AWS, Microsoft Azure, GCP, VMware, Databricks, and more, the company serves mid-market and enterprise clients, offering comprehensive expertise in Cloud Migration, Data Platforms, DevOps, IoT, AI/ML, and more.

CloudThat is recognized as a top-tier partner with AWS and Microsoft, including the prestigious ‘Think Big’ partner award from AWS and the Microsoft Superstars FY 2023 award in Asia & India. Having trained 650k+ professionals in 500+ cloud certifications and completed 300+ consulting projects globally, CloudThat is an official AWS Advanced Consulting Partner, AWS Training Partner, AWS Migration Partner, AWS Data and Analytics Partner, AWS DevOps Competency Partner, Amazon QuickSight Service Delivery Partner, Amazon EKS Service Delivery Partner, Microsoft Gold Partner, AWS Microsoft Workload Partners, Amazon EC2 Service Delivery Partner, and many more.

To get started, go through our Consultancy page and Managed Services PackageCloudThat’s offerings.


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.


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.



    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!