Install Nexus Repository Manager in Amazon Linux
- Remove older version of java and install latest version:
yum remove java* -y sudo yum install java-1.8.0-openjdk.x86_64 -y
- Download and setup nexus stable version
cd /opt wget https://sonatype-download.global.ssl.fastly.net/nexus/3/nexus-3.0.2-02-unix.tar.gz tar -zxvf nexus-3.0.2-02-unix.tar.gz mv /opt/nexus-3.0.2-02 /opt/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 \\ nexus ALL=(ALL) NOPASSWD: ALL sudo chown -R nexus:nexus /opt/nexus
- Open /opt/nexus/bin/nexus.rc file, uncomment run_as_user parameter and set it as following.
vi /opt/nexus/bin/nexus.rc run_as_user="nexus" (file shold have only this line)
- 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
- Login nexus server from browser on port 8081
http://<Nexus_server>:8081
- Use default credentials to login
username : admin password : admin123