Monday 11 March 2019

How to install Nexus on EC2 by Raj Gupta


Nexus:-Nexus is one a artifact repository which helps to store your build outcomes.
Minimum Memory for this is 4G. try in t2.Medium server if you are doing it on  AWS.

yum update
yum install java-1.8*
java -version
cd /opt
yum install wget -y
tar -zxvf  nexus-3.0.2-02-unix.tar.gz
mv /opt/nexus-3.0.2-02 /opt/nexus    -------rename it
cd nexus

As a good security practice, it is not advised to run nexus service as root. so create new user called nexus and grant sudo access to manage nexus services

sudo adduser nexus
visudo                 -----go to this sudo file and add this user under root and give same permission as root(nexus   ALL=(ALL)       ALL)

then set the password for this user
passwd nexus

sudo chown -R nexus:nexus /opt/nexus
ls -ld /opt/nexus

Now open /opt/nexus/bin/nexus.rc file, uncomment run_as_user parameter and set it as following.

vi /opt/nexus/bin/nexus.rc     and add run_as_user="nexus" line to file

Add nexus as a service at boot time

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

Login as a nexus user and start service

su - nexus
service nexus start
service nexus status


Login nexus server from browser on port 8081

http://<Nexus_server ip address>:8081

Use default credentials to login

username : admin
password : admin123



No comments:

Post a Comment