Facebook
Twitter
LinkedIn
YouTube
GitHub
Hasan's Blog
  • General
  • CI/CD
  • DevOps
  • Test Mgmt & Automation
  • Blog
    • About me

How to install Sonatype Nexus 3 on Centos6.10

2019/09/21Hasan YousufDevOps

Install Sonatype Nexus 3 on Centos6.10

Sonatype Nexus is one of the best repository managers out there. It is some tool that you cannot avoid in your CI/CD pipeline. It effectively manages deployable artifacts.

This article guides you to install and configure Sonatype Nexus 3 in a secure way on an Centos6.10 Linux System.

Note: This was tested on a Centos 6.10 machine and it will work on Centos 7 as well.

Step 1: Login to your Linux server and update it.

sudo yum update -y

Step 2: Install OpenJDK 1.8

Note: Nexus recommends oracle JDK to be installed. For demo purposes we use OpenJDK

sudo yum install java-1.8.0-openjdk.x86_64

Step 3: Create a directory named app and cd into the directory.

sudo mkdir /app && cd /app

Step 4: Download the latest nexus. You can get the latest download links fo for nexus from here. Here I am downloading nexus 3.

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

Untar the downloaded file.

sudo tar -xvf nexus-3.18.1-01-unix.tar.gz

Rename the untared file to nexus.

sudo mv nexus-3.18.1-01 nexus

Step 5: As a good security practice, it is not advised to run nexus service with any sudo user. So create a new user named nexus.

sudo adduser nexus

Change the ownership of nexus file to nexus user.

sudo chown -R nexus:nexus /app/nexus

Open /app/nexus/bin/nexus.rc file, uncomment run_as_user parameter and set it as following.

run_as_user="nexus"

Step 6: If you want to change the default nexus data directory, open nexus properties file and change the data directory “-Dkaraf.data” parameter to a preferred location as shown below.

sudo vi /app/nexus/bin/nexus.vmoptions

An example configuration is shown below.

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

Running Nexus as a Service

It is better to have a init.d entry to manage nexus service using the Linux service command. Follow the steps given below for the setup.

Step 1: Create a symbolic link for nexus service script to /etc/init.d folder.

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

Step 2: Execute the following commands to add nexus service to boot.

	
sudo chkconfig --add nexus
sudo chkconfig --levels 345 nexus on

Manage Nexus Service

Now we have all the configurations in place. To start the Nexus service, use the following command.

sudo service nexus start

The above command will start the nexus service on port 8081. To access the nexus dashboard, visit http://:8081. You will be able to see the nexus homepage as shown below.

To log in, use the default username and password.

User Name: admin
Password: admin123

For stopping,

sudo service nexus stop

For restarting,

sudo service nexus restart
Review
Sending
User Review
0 (0 votes)

Related Posts:

  • How To Install Java with Apt-Get on Ubuntu 16.10
  • dial unix /var/run/docker.sock: permission denied
  • Install Node.js on Ubuntu 16.04
  • Schedule a job periodically in Jenkins during working days
  • CURD functions and REST api
  • Minimise your development time by automating your…

Share this:

  • Twitter
  • Facebook

Related

Previous post How to completely uninstall Android Studio on MAC? Next post How to setup network after RHEL/CentOS 7 minimal installation

Hasan Naqvi

Categories

  • Casperjs (1)
  • CI/CD (4)
  • DevOps (6)
  • Gruntjs (2)
  • Jira (1)
  • Linux (1)
  • Programming (1)
  • Uncategorized (14)
  • VMware (1)

Archives

  • May 2020 (1)
  • April 2020 (1)
  • March 2020 (2)
  • September 2019 (2)
  • May 2018 (1)
  • September 2017 (3)
  • July 2017 (1)
  • June 2017 (4)
  • May 2017 (1)
  • July 2015 (2)
  • January 2015 (1)
  • October 2014 (1)
  • September 2014 (5)
  • August 2014 (1)

Tags

Arduino Arduino sketch Arduino sketch upload bash shell casperjs Couchdb Curl docker container docker images github Gitlab gnu Parallel gruntjs JAVA JAVA jenkins Jira JPA Json Linux linux mint Maven mint MYSQL Tomcat Ubuntu Version Control xpath

Top Posts & Pages

  • CURD functions and REST api
  • How to completely uninstall Android Studio on MAC?
  • Before you can run vmware several modules must be compiled and loaded into the running kernel
  • Trying to upload Blink example (Arduino sketch) on my Arduino uno
  • fill form using xpath in casperjs
  • Delete docker images & containers in one command
  • How to import data in couchdb using JSON file

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

  • General
  • CI/CD
  • DevOps
  • Test Mgmt & Automation
  • Blog
    • About me
@2017