Install Nexus Repository on Ubuntu 20.04

Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"
Nexus Repository Manager - Certified OpenShift Operator - Red Hat Ecosystem  Catalog

Nexus Repository OSS is an open source repository that supports many artifact formats, including Docker, Java™, NuGet, Helm, Docker, P2, OBR, APT, GO, R, Conan components and more

Lets see how to install Nexus repository on Ubuntu Machine.

Pre-Requisites:

Update your Ubuntu OS

#apt update

#apt install net-tools wget openjdk -y

Below Link is for Nexus installer download archives

https://help.sonatype.com/repomanager3/download/download-archives—repository-manager-3

Download nexus installer using below command

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

File has been Download
Un tar the installer file

Rename nexus-3.28.1-01 to nexus

#mv nexus-3.28.1-01 nexus

Move the nexus directory to /opt/directory

Move sonatype-work directory into opt directory

#mv sonatype-work /opt

Create a user called Nexus

#useradd nexus

Give permission to Nexus user
# chown -R nexus:nexus /opt/nexus
# chown -R nexus:nexus /opt/sonatype-work

Edit below nexus.rc file to add nexus user.

vi /opt/nexus/bin/nexus.rc

run_as_user=”nexus”

Then we need to Configure Nexus to run as systemd as service

vi /etc/systemd/system/nexus.service

[Unit]
Description=nexus service
After=network.target
  
[Service]
Type=forking
LimitNOFILE=65536
ExecStart=/opt/nexus/bin/nexus start
ExecStop=/opt/nexus/bin/nexus stop
User=nexus
Restart=on-abort
TimeoutSec=600
  
[Install]
WantedBy=multi-user.target

Activate the service with the following commands:

sudo systemctl daemon-reload 
sudo systemctl enable nexus.service 
sudo systemctl start nexus.service

Check nestat status for 8081 port.

root@server:/opt/nexus/bin# netstat -tnpl | grep 8081
tcp 0 0 127.0.0.1:8081 0.0.0.0:* LISTEN 7384/java

find password using below command.

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

username is admin by default.

Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"
Mel
Melhttps://unixcop.com
Unix/Linux Guru and FOSS supporter

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest articles

Join us on Facebook