Home Ubuntu Linux Install Nexus Repository Manager on Ubuntu
Ubuntu Linux

Install Nexus Repository Manager on Ubuntu

Install Nexus Repository Manager on Ubuntu
Richard
Written byRichardTech Writer, IT Professional
Nov 9, 2022 Updated Apr 18, 2026 3 min read Reviewed Apr 18, 2026

This guide explains how to install Nexus Repository Manager on Ubuntu. Nexus acts as a central hub to store and manage your application files and software packages. It helps teams share code and tools easily across different servers.

Why use Nexus? It simplifies managing packages for languages like Java, npm, NuGet, and Python. It keeps your files organized and ready for deployment.

What happens when done? You will have a running repository manager accessible through your web browser, allowing you to host and distribute your own software components.

Install Java

Nexus requires a modern version of Java to run. For 2026, you should use OpenJDK 17 or 21, as these are the long-term support versions required by current Nexus releases.

Run these commands to update your system and install OpenJDK 21:

🐧Bash / Shell
sudo apt update
sudo apt install openjdk-21-jdk

You can find more details on managing Java versions at How to install and use OpenJDK on Ubuntu Linux.

Install Nexus Repository Manager

Now, let’s download the latest stable version of Nexus. We will move the files to the /opt directory to keep things organized.

Run these commands to download and extract the files:

Command Prompt
cd /tmp
wget https://download.sonatype.com/nexus/3/nexus-3.77.0-02-unix.tar.gz
tar xzf nexus-3.77.0-02-unix.tar.gz
sudo mv nexus-3.77.0-02 /opt/nexus
sudo mv sonatype-work /opt/

Next, we create a dedicated user account to run Nexus safely. This account will not be used to log in to the system.

🐧Bash / Shell
sudo useradd -m -d /opt/nexus -U -r -s /bin/bash nexus
sudo chown -R nexus:nexus /opt/nexus /opt/sonatype-work

Configure Nexus to run on Ubuntu

We need to tell Nexus to run as the new user and start automatically when your server boots.

Edit the configuration file to set the user:

🐧Bash / Shell
sudo nano /opt/nexus/bin/nexus.rc

Uncomment the line and set it to: run_as_user="nexus".

For custom settings like memory limits, use the nexus.vmoptions file or the dedicated configuration directory instead of changing default files.

Now, create a system service file to manage the application:

🐧Bash / Shell
sudo nano /etc/systemd/system/nexus.service

Paste these lines into the file:

💻Code
[Unit]
Description=nexus service
After=network.target

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

[Install]
WantedBy=multi-user.target

Start the service with these commands:

🐧Bash / Shell
sudo systemctl daemon-reload
sudo systemctl start nexus.service
sudo systemctl enable nexus.service

To access the web interface, open your browser and go to http://your-server-ip:8081.

ubuntu install nexus repository manager web portal
ubuntu install nexus repository manager web portal

To log in for the first time, you need the initial admin password. Retrieve it by running:

🐧Bash / Shell
sudo cat /opt/sonatype-work/nexus3/admin.password

Enter this password in the browser. You will be prompted to create a new, secure password.

ubuntu nexus repository manager admin dashboard
ubuntu nexus repository manager admin dashboard

Run Nexus behind a proxy

For better security and performance, it is best to run Nexus behind a web server like Nginx or Apache. See these guides for help:

How to set up a reverse proxy with Nginx

How to set up a reverse proxy with Apache

For more official documentation, visit https://help.sonatype.com/docs.

[Unit] [Service] [Install]

Was this guide helpful?

Richard

About the Author

Richard

Tech Writer, IT Professional

Richard, the owner and lead writer at Geek Rewind, is a tech enthusiast passionate about simplifying complex IT topics. His years of hands-on experience in system administration and enterprise IT operations have honed his ability to provide practical insights and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.

2452 articles → Twitter

📚 Related Tutorials

Change Desktop Background in Ubuntu Linux
Ubuntu Linux Change Desktop Background in Ubuntu Linux
How to Install Froxlor with Nginx on Ubuntu 24.04
Ubuntu Linux How to Install Froxlor with Nginx on Ubuntu 24.04
How to Install RustDesk on Ubuntu Linux
Ubuntu Linux How to Install RustDesk on Ubuntu Linux
How to Change Screen Brightness in Ubuntu Linux
Ubuntu Linux How to Change Screen Brightness in Ubuntu Linux

Leave a Reply

Your email address will not be published. Required fields are marked *