Nexus Installation & Configuration step by step
how to install and configure nexus on Linux
===============================
organization name: sonatype
product name: nexus
purpose: to store build artifacts
and also docker images
server requirement: 1.os:amazon Linux
2.CPU & RAM: 2CPU 4GB RAM
select instance type family: t3.medium --very less cost
3.HardDisk:30 GB
4.Java software Version 11
5.must open the port number :8081
step1: create server with above configuration
step2: edit the inbound rules means open the port number 8081
recommended to create security group
and open port numbers 22 and 8081
ex: security group name: nexus
after creating security group ,
you must attach to the server
step3:login Linux Server
step4:install java software version 11 preferable recommended
yum whatprovides java
yum whatprovide python
select java version 11 and install into your server
yum install java-11-amazon-corretto -y
open opt folder
step5:cd /opt
open nexus download page:
https://help.sonatype.com/en/download.html
copy the download link
step6:wget https://download.sonatype.com/nexus/3/nexus-3.87.1-01-linux-x86_64.tar.gz
after downloading extract the folder
step7:tar xvzf nexus-3.87.1-01-linux-x86_64.tar.gz
you will get two folders
1.nexus-3.87.1-01
2.sonatype-work
step8:rename nexus folder
mv nexus-3.87.1-01 nexus3
step9:create a user
useradd nexus
step10:modify sshd_config file
vim /etc/ssh/sshd_config
step11:restart the sshd service
step12:open sudoers file
(vim /etc/sudoers) -it is not recommended
visudo it is recommended
nexus ALL=(ALL) NOPASSWD: ALL
SAVE & EXIT --->ctrl+o enter button ctrl+x
step13:Please change ownership and group name for the two folders
1.nexus folder
2. sonatype-work folder
we use "chown" command to change ownership and group
chown -R nexus:nexus nexus
chown -R nexus:nexus sonatype-work
chmod -R 777 nexus
chmod -R 777 sonatype-work
step15: open vim /etc/systemd/system/nexus.service
copy & paste script
[Unit]
Description=nexus service
After=network.target
[Service]
Type=forking
LimitNOFILE=65536
Group=nexus
ExecStart=/opt/nexus/bin/nexus start
ExecStop=/opt/nexus/bin/nexus stop
User=nexus
Restart=on-abort
[Install]
WantedBy=multi-user.target
switch to nexus user
step16 :open vim /opt/nexus/bin/nexus.rc
provide user details inside nexus.rc file
just enter the line
run_as_user="nexus"
run_as_user="paparao"
step17:sudo systemctl enable nexus
step18:sudo systemctl start nexus
step19:sudo systemctl status nexus
now it is in running state
step20:open browser
paste the server Public IP Address:8081
press enter button
step21: you are able to nexus home and user login page
step22: user name : admin
password: ?
the password is available inside sonatype-work folder
to see the password just use the below
cat /opt/sonatype-work/nexus3/admin.password
you will get the password
now, copy the password
paste it in the login page
step23: now, you are able to see the nexus repositories
Comments
Post a Comment