Installation and Initial Setup of Nexus Repository Manager on Linux

Nexus Repository Manager is a powerful tool for managing artifacts and dependencies. Whether you're using the open-source (OSS) or Pro version, this guide will walk you through the installation and initial setup process on a Linux system.

Step 1: Prerequisites

Before installing Nexus Repository Manager, ensure your system meets the following requirements:

  • Java Development Kit (JDK) 8 or higher installed.
  • At least 4GB of RAM (8GB recommended for production).
  • Enough disk space for your repositories.

To check if Java is installed, run:

java -version

If Java is not installed, you can install it using:

sudo apt update
sudo apt install openjdk-11-jdk

Step 2: Download Nexus Repository Manager

Download the latest version of Nexus Repository Manager (OSS or Pro) from the official website. Alternatively, use wget to download it directly to your server:

wget https://download.sonatype.com/nexus/3/latest-unix.tar.gz

Step 3: Extract the Archive

Once the download is complete, extract the archive to your desired installation directory:

tar -xvzf latest-unix.tar.gz -C /opt

This will extract the files to /opt/nexus-<version>.

Step 4: Create a Nexus User

For security purposes, create a dedicated user to run Nexus Repository Manager:

sudo useradd -M -d /opt/nexus -s /bin/bash -r nexus
sudo chown -R nexus:nexus /opt/nexus-<version>

Step 5: Configure Nexus

Edit the nexus.vmoptions file to configure memory settings:

sudo nano /opt/nexus-<version>/bin/nexus.vmoptions

Adjust the memory settings as needed, for example:

-Xms2703m
-Xmx2703m

Step 6: Start Nexus Repository Manager

Switch to the Nexus user and start the service:

sudo su - nexus
/opt/nexus-<version>/bin/nexus start

You can check the status of the service with:

/opt/nexus-<version>/bin/nexus status

Step 7: Access the Web Interface

Once the service is running, open your web browser and navigate to:

http://<your-server-ip>:8081

Log in with the default credentials:

  • Username: admin
  • Password: admin123

Change the default password immediately after logging in.

Step 8: Configure Initial Settings

After logging in, configure the following:

  • Base URL: Set the base URL for your Nexus instance.
  • Storage: Configure the storage location for your repositories.
  • Security: Set up user roles, permissions, and authentication.

Step 9: Explore the Web Interface

Take some time to explore the Nexus web interface. Key features include:

  • Repository Management: Create and manage repositories (proxy, hosted, and group).
  • Artifact Browsing: Browse and search for artifacts.
  • Task Scheduling: Schedule tasks like cleanup and backups.
  • Logs: View system logs for troubleshooting.

Conclusion

You’ve successfully installed and configured Nexus Repository Manager on Linux. With the initial setup complete, you can now start managing your artifacts and integrating Nexus with your build tools. For advanced configurations, refer to the official Nexus documentation.

Post a Comment

0 Comments