Skip to content

This repo demos the installation of nexus on ubuntu server and accessing nexus ui from Web browser

Notifications You must be signed in to change notification settings

hemu07/Nexus-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 

Repository files navigation

Nexus-Demo

This repo demos the installation of Nexus on the Ubuntu server and accessing Nexus UI from a Web browser

  • Spin up an EC2 instance on AWS, allow TCP connections on port 22 in the inbound rule for the security group attached to this instance, and allow TCP connection on port 8081 to access Nexus service image

  • Remote server (ec2 instance) requirements:

    • 8 GB RAM (4GB will also work)
    • 2 vCPU
    • RSA key used to launch instance safely downloaded locally
    • Ubuntu AMI (Ubuntu server 22.0 LTS)
  • once the instance is running connect to the instance either via ec2 instance connect or SSH into the server using rsa key-pair image

  • Run the below commands as a prerequisite to installing Nexus:

    • sudo apt update
    • sudo apt install openjdk-8-jre-headless
    • sudo adduser nexus
    • sudo usermod -aG sudo nexus image we will use this user to run the nexus service, as a security best practice is not to grant more permissions than needed to work with
    • cd /opt
  • Installing Nexus

  • Configuring Nexus service

    • sudo vi /etc/systemd/system/nexus.service
    • add below script to run nexus as service =============================================================

    [Unit] Description=Nexus Repository Manager After=network.target

    [Service] Type=forking LimitNOFILE=65536 User=nexus Group=nexus WorkingDirectory=/opt/nexus-3.66.0-02 ExecStart=/opt/nexus-3.66.0-02/bin/nexus start ExecStop=/opt/nexus-3.66.0-02/bin/nexus stop Restart=on-abort

    [Install] WantedBy=multi-user.target

=============================================================

link to the script: [Nexus-documentation] (https://help.sonatype.com/en/run-as-a-service.html#:~:text=%5BUnit%5D%0ADescription%3Dnexus%20service%0AAfter%3Dnetwork.target%0A%20%20%0A%5BService%5D%0AType%3Dforking%0ALimitNOFILE%3D65536%0AExecStart%3D/etc/init.d/nexus%20start%0AExecStop%3D/etc/init.d/nexus%20stop%20%0AUser%3Dnexus%0ARestart%3Don%2Dabort%0ATimeoutSec%3D600%0A%20%20%0A%5BInstall%5D%0AWantedBy%3Dmulti%2Duser.target)

  • sudo ln -s /opt/nexus-3.66.0-02/bin/nexus /etc/init.d/nexus

  • su - nexus

  • Running Nexus as nexus user:

    • sudo update-rc.d nexus defaults
    • sudo systemctl daemon-reload
    • sudo systemctl enable nexus.service
    • sudo systemctl start nexus.service
    • sudo systemctl status nexus
    • ps aux | grep nexus
    • sudo apt install net-tools
    • netstat -lnpt

    image

    image

    • cat /opt/sonatype-work/nexus3/admin.password
    • give this password to signin for the first time in UI , which will redirect to reset the password, once done we can see the below output: image
    • check the logs using below command:
    • tail -f /opt/sonatype-work/nexus3/log/nexus.log

About

This repo demos the installation of nexus on ubuntu server and accessing nexus ui from Web browser

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published