Atlantic.Net Blog

How to Install Sonatype Nexus Repository Manager on Oracle Linux 8

Hitesh Jethva
by Atlantic.Net (447 posts) under Dedicated Server Hosting, Tutorials
0 Comments

Sonatype Nexus is a free, open-source artifact management tool that helps you to manage artifacts effectively across your software supply chain. It provides a single source of truth for every component with native package manager compatibility. It can be integrated with your existing user and authentication systems like LDAP and Atlassian Crowd. Sonatype Nexus is compatible with popular IDEs and CI like Eclipse, IntelliJ, Visual Studio, Jenkins, and more.

In this post, we will show you how to install Sonatype Nexus on Oracle Linux 8.

Prerequisites

  • A fresh Oracle Linux 8 server on the Atlantic.Net Cloud Platform
  • A root password configured on your server

Step 1 – Create Atlantic.Net Cloud Server

First, log in to your Atlantic.Net Cloud Server. Create a new server, choosing Oracle Linux 8 as the operating system with at least 2GB RAM. Connect to your Cloud Server via SSH and log in using the credentials highlighted at the top of the page.

Once you are logged in to your Oracle Linux 8 server, run the following command to update your base system with the latest available packages.

dnf update -y

Step 2 – Install Java JDK

Sonatype Nexus is a Java-based application, so Java must be installed on your system. If not installed, you can install it with the following command:

dnf install java-1.8.0-openjdk.x86_64 -y

Once Java is installed, you can verify the Java version using the following command:

java -version

You should see the following output:

openjdk version "1.8.0_342"
OpenJDK Runtime Environment (build 1.8.0_342-b07)
OpenJDK 64-Bit Server VM (build 25.342-b07, mixed mode)

Step 3 – Install Sonatype Nexus Oracle Linux 8

First, create a dedicated user to run Nexus with the following command:

adduser nexus

Next, create the required directory to store Nexus files:

mkdir /app

Next, change the directory to /app and download the latest version of Nexus with the following command:

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

Next, extract the downloaded file with the following command:

tar -xvf nexus.tar.gz

Next, rename the extracted directory with the following command:

mv nexus-3* nexus

Next, change the ownership and permissions of the Nexus directory with the following command:

chown -R nexus:nexus /app/nexus
chown -R nexus:nexus /app/sonatype-work

Next, edit the Nexus configuration file and define the Nexus user:

nano /app/nexus/bin/nexus.rc

Change the following line:

run_as_user="nexus"

Save and close the file when you finish.

Step 4 – Create a Systemd Service File for Nexus

Next, you will need to create a systemd service file to manage the Nexus via systemd.

You can create it with the following command:

nano /etc/systemd/system/nexus.service

Add the following configurations:

[Unit]
Description=nexus service
After=network.target

[Service]
Type=forking
LimitNOFILE=65536
User=nexus
Group=nexus
ExecStart=/app/nexus/bin/nexus start
ExecStop=/app/nexus/bin/nexus stop
User=nexus
Restart=on-abort

[Install]
WantedBy=multi-user.target

Save and close the file, then reload the systemd daemon with the following command:

systemctl daemon-reload

Next, start and enable the Nexus service with the following command:

systemctl start nexus
systemctl enable nexus

You can check the status of the Nexus service using the following command:

systemctl status nexus

You will get the following output:

● nexus.service - nexus service
   Loaded: loaded (/etc/systemd/system/nexus.service; disabled; vendor preset: disabled)
   Active: active (running) since Thu 2022-09-01 07:51:39 EDT; 5s ago
  Process: 13727 ExecStart=/app/nexus/bin/nexus start (code=exited, status=0/SUCCESS)
 Main PID: 13939 (java)
    Tasks: 47 (limit: 49496)
   Memory: 509.2M
   CGroup: /system.slice/nexus.service
           └─13939 /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.342.b07-2.el8_6.x86_64/jre/bin/java -server -Dinstall4j.jvmDir=/usr/lib/jvm/java-1.8>

Sep 01 07:51:39 oraclelinux8 systemd[1]: Starting nexus service...
Sep 01 07:51:39 oraclelinux8 systemd[1]: Started nexus service.

Step 5 – Access Nexus Web Interface

At this point, Nexus is started and listens on port 8081. You can check it with the following command:

ss -antpl

You will get the following output:

State        Recv-Q       Send-Q             Local Address:Port              Peer Address:Port       Process                                  
LISTEN       0            1                      127.0.0.1:42221                  0.0.0.0:*           users:(("java",pid=13939,fd=118))       
LISTEN       0            50                       0.0.0.0:8081                   0.0.0.0:*           users:(("java",pid=13939,fd=971)) 

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:

cat /app/sonatype-work/nexus3/admin.password

You should see the Nexus admin password in the following output:

9691dbd2-6d32-41a5-b4d4-e6ada1643869

Now, open your web browser and access the Nexus web interface using the URL http://your-server-ip:8081. You should see the Nexus home page:
Nexus dashboard page

Conclusion

In this tutorial, we explained how to install Nexus on Oracle Linux 8. You can now start managing your packages across your software supply chain. For more information, visit the Nexus documentation. Try it on dedicated hosting from Atlantic.Net!

Get A Free To Use Cloud VPS

Free Tier Includes:
G3.2GB Cloud VPS Free to Use for One Year
50 GB of Block Storage Free to Use for One Year
50 GB of Snapshots Free to Use for One Year


Looking for a Hosting Solution?

We Provide Cloud, Dedicated, & Colocation.

  • Seven Global Data Center Locations.
  • Flexible Private, Public, & Hybrid Hosting.
  • 24x7x365 Security, Support, & Monitoring.
Contact Us Now! Med Tech Award FTC
SOC Audit HIPAA Audit HITECH Audit

Recent Posts

How to Install and Use Composer on Oracle Linux 8
How to Install Sails.js Framework with Nginx as a Reverse Proxy on Oracle Linux 8
Are Data Breaches In The Cloud Getting Better Or Worse?
How to setup HTTP Strict Transport Security (HSTS) for Apache on Oracle Linux 8
How to Install Kanban Kanboard on Oracle Linux 8

Get started with 12 months of free cloud VPS hosting

Free Tier includes:
G3.2GB Cloud VPS Server Free to Use for One Year
50 GB of Block Storage Free to Use for One Year
50 GB of Snapshots Free to Use for One Year


New York, NY

100 Delawanna Ave, Suite 1

Clifton, NJ 07014

United States

San Francisco, CA

2820 Northwestern Pkwy,

Santa Clara, CA 95051

United States

Dallas, TX

2008 Lookout Dr,

Dallas, Texas 75044

United States

Ashburn, VA

1807 Michael Faraday Ct,

Reston, VA 20190

United States

Orlando, FL

440 W Kennedy Blvd, Suite 3

Orlando, FL 32810

United States

Toronto, Canada

20 Pullman Ct, Scarborough,

Ontario M1X 1E4

Canada

London, UK

14 Liverpool Road, Slough,

Berkshire SL1 4QZ

United Kingdom

Resources