Monday, March 12, 2018

Install Nexus on Ubuntu - Install Nexus 3 on Ubuntu 16.0.4 - How to set up Nexus on Ubuntu server?

How to Install Nexus on Ubuntu:

SonaType Nexus3 is Java based application, it is used as binary repository manager. We need to install Java first.

Java

sudo apt-get update 
sudo apt-get install default-jdk -y


Execute the below commands -  navigate to /opt directory by changing directory:
cd /opt

Download Nexus

sudo wget https://sonatype-download.global.ssl.fastly.net/nexus/3/nexus-3.0.2-02-unix.tar.gz

Extract Nexus

sudo tar -xvf nexus-3.0.2-02-unix.tar.gz
sudo mv nexus-3.0.2-02 nexus

Create a user called Nexus
sudo adduser nexus
give some password may be ad nexus, but do remember.

sudo chown -R nexus:nexus /opt/nexus
sudo vi /opt/nexus/bin/nexus.rc
change run_as_user="nexus"
sudo vi /opt/nexus/bin/nexus.vmoptions
Add all the below changes the file with below yellow highlighted entry:



-Xms256M
-Xmx256M
-XX:+UnlockDiagnosticVMOptions
-XX:+UnsyncloadClass
-Djava.net.preferIPv4Stack=true
-Dkaraf.home=.
-Dkaraf.base=.
-Dkaraf.etc=etc
-Djava.util.logging.config.file=etc/java.util.logging.properties
-Dkaraf.data=/opt/nexus/nexus-data
-Djava.io.tmpdir=data/tmp
-Dkaraf.startLocalConsole=false

sudo ln -s /opt/nexus/bin/nexus /etc/init.d/nexus

sudo su - nexus
give password for nexus which was nexus per above
type 
cd /opt/nexus/bin
./nexus start

./nexus status

it should show nexus is running..



if it says stopped, review the steps above. also navigate to logs by

cat /opt/nexus/nexus-data/log/nexus.log

look for any error.

It should say Nexus is running..If you Nexus stopped, review the steps above.
Once Nexus is successfully installed, you can access it in the browser by 



with user name/password is admin/admin123
you should see the home page of Nexus

No comments:

Post a Comment

DevOps Coaching Program Model Information | AWS Cloud Azure Cloud DevOps Coaching Program Model Information

Thanks for showing interest in learning DevOps. Believe it or not, anyone can become a successful DevOps engineer after finishing the excit...