How to Install latest Sonatype Nexus 3 In Linux - Tecnew

Home Ads

How to Install latest Sonatype Nexus 3 In Linux

How to Install latest Sonatype Nexus 3 In Linux

Share This

 

Nexus 3 Installation:

Sonatype nexus is the best one of the repository. It is most used your CI/CD pipeline it is mostly manages the artifact deploying.

 Requirements:

1 VCPU and 2GB Memory

Firewall ports for 22 and 8081

Open JDK 8

 Sonatype Nexus 3 on Linux (Centos) Ec2 Instance:

Step 1:

Login to your Linux server and update it. Also install required utilities and switch to sudo -i user

yum update -y

yun install wget -y

 Step 2: 

Install OpenJdk 1.8

yum install java-1.8.0-openjdk.x86_64 -y

Step 3: 

Create a directory named apps and cd in to that directory

mkdir  /apps  &&  cd  /apps

Step 4:

Download the late nexus from following link Download (sonatype.com) or

wget -O nexus.tar.gz https://download.sonatype.com/nexus/3/latest-unix.tar.gz

Untar file downloaded

tar -xvf nexus.tar.gz

Rename the directory

mv nexus-3* nexus

Step 5: 

For good security practice it is not advised to run nexus service with any sudo user So create new sudo user name by nexus

            useradd nexus

Change the ownership permissions of nexus file and nexus data directory to nexus user

            chown -R nexus:nexus /apps/nexus

            chown -R nexus:nexus /apps/sonatype-work

Step 6: 

Open /apps/nexus/bin/nexus.rc file

            sudo vi  /app/nexus/bin/nexus.rc

Uncomment run as user parameter and set it as following

            run_as_user="nexus"

Step 7:

Runing the Nexus service as a system service

            vi /etc/systemd/system/nexus.service

Add the following content to unit file

[Unit]

Description=nexus service

After=network.target

 

[Service]

Type=forking

LimitNOFILE=65536

User=nexus

Group=nexus

ExecStart=/app/nexus/bin/nexus start

ExecStop=/app/nexus/bin/nexus stop

User=nexus

Restart=on-abort

 

[Install]

WantedBy=multi-user.target


Manage Nexus Service

            chkconfig nexus on

To start the Nexus service

            systemctl start nexus

Above command stsrt the nexus service on port 8081 to access the nexus dash board visit http://localip:8081

No comments:

Post a Comment