In this tutorial we will go through how
to install and configure Sonatype Nexus Repository manager in CentOS 7/8.
1) Login to your
Linux server and update it.
sudo yum update -y
sudo yum install epel-release -y
sudo yum install java-11-openjdk -y
2) Create a directory named app and cd into the
directory.
sudo mkdir /app && cd /app
3) Download the latest nexus. You can get the latest
download links fo for nexus from
sudo wget https://download.sonatype.com/nexus/3/latest-unix.tar.gz -O nexus.tar.gz
sudo tar -zxvf nexus.tar.gz
sudo ln -s nexus-* nexus
4) Create Nexus user and provide permissions to nexus
home directory.
useradd nexus
chown -R nexus:nexus /app/nexus
5) Configure Nexus to run as Service in Linux machine.
sudo ln -s /app/nexus/bin/nexus /etc/init.d/nexus
sudo chown nexus:nexus /etc/init.d/nexus
sudo chkconfig --add nexus
sudo systemctl enable nexus
6) Start the nexus service.
sudo service nexus start
7) After few mins please access the Nexus Repository
Manager at http://{hostname}:8081
Please add below line in Vagrantfile and restart your vm to access nexus UI on your browser.
jenkins_config.vm.network "forwarded_port", guest: 8081, host: 8081
8) In the recent versions of nexus we need to configure admin password during our first time login. Onetime password will be located in below location. we need to use this password to configure admin password.
Run below command to see the default password.
cat /app/sonatype-work/nexus3/admin.password