Deployment guide

Nexus Repository

Videos

Overview: Nexus Repository on Azure: overview (watch on YouTube)

Launch and log in: Nexus Repository on Azure: launch and log in (watch on YouTube)

Deep Dive: Nexus Repository on Azure: deep dive (watch on YouTube)

Overview

Sonatype Nexus Repository OSS is a universal artifact repository manager. It stores and serves the binary artifacts your builds produce and consume, and it can proxy and cache remote registries so your CI fleet pulls dependencies from a single, fast local mirror. It handles many formats out of the box, including Maven, npm, Docker, NuGet, PyPI, RubyGems and raw files.

The SecureAnyCloud image installs the free, open source edition (Eclipse Public License 1.0) of Nexus Repository 3.70.4-02 on OpenJDK 17. It runs behind an nginx reverse proxy on port 80, as a dedicated nexus service account bound to the loopback interface. All repository storage, the embedded database and the search index live on a dedicated Azure data disk, and the first boot of every VM generates a unique admin password. The image is backed by 24/7 SecureAnyCloud support.

What you get:

  • Sonatype Nexus Repository OSS 3.70.4-02 (Eclipse Public License 1.0) on OpenJDK 17
  • The Nexus web console for browsing, searching, uploading and administering repositories
  • Default Maven and NuGet hosted, proxy and group repositories, ready to extend to npm, Docker, PyPI and more
  • nginx on :80 as a reverse proxy to the loopback Nexus connector on 127.0.0.1:8081
  • A per-VM admin account generated on first boot and recorded in a root-only file
  • A dedicated Azure data disk at /var/lib/nexus for blob stores, the embedded database and the search index
  • nexus.service (running as the unprivileged nexus user) and nginx.service as systemd units, enabled and active
  • An unauthenticated /health endpoint for Azure Load Balancer health probes
  • 24/7 SecureAnyCloud support

Prerequisites

Before you deploy, make sure you have an active Azure subscription, an SSH key pair, and a VNet plus subnet in the target region.

Standard_B4ms (4 vCPU / 16 GiB RAM) is a sensible starting point, because Nexus is a JVM application with a 2.7 GiB default heap. Size up for larger repositories or busier proxy traffic.

In the NSG, allow inbound 22/tcp from your management network and 80/tcp. Nexus serves plain HTTP on port 80. For production, terminate TLS in front of it with your own domain.

Step 1 - Deploy from the Azure Marketplace

Sign in to the Azure Portal, choose Create a resource, search the Marketplace for Sonatype Nexus Repository by SecureAnyCloud, and select Create.

On Basics, pick your subscription, resource group, region and size. Under Administrator account, choose SSH public key and paste your key. Under Inbound port rules, allow SSH (22) and HTTP (80).

Review the dedicated data disk on the Disks tab, then choose Review + create and Create.

Step 2 - Deploy from the Azure CLI

# Accept the Marketplace terms once per subscription (required before the first CLI deploy)
az vm image terms accept --urn sac1647283583153:nexus-repository-ubuntu-24-04:default:latest
az vm create \
  --resource-group <your-rg> \
  --name nexus \
  --image sac1647283583153:nexus-repository-ubuntu-24-04:default:latest \
  --size Standard_B4ms \
  --admin-username azureuser \
  --ssh-key-values ~/.ssh/id_ed25519.pub \
  --vnet-name <your-vnet> --subnet <your-subnet> \
  --public-ip-sku Standard
az vm open-port --resource-group <your-rg> --name nexus --port 80 --priority 1010

First boot takes a few minutes. On its first boot, the VM finishes its per-VM setup in the background by generating this VM's own credentials and starting the services. If you connect as soon as the VM shows as running, wait for that setup to complete before you continue:

bash sudo cloud-init status --wait

The command prints status: done when the VM is ready. The credentials and services described below are present only after that.

Step 3 - Connect to your VM

ssh azureuser@<vm-public-ip>

Step 4 - Confirm the services are running

systemctl is-active nexus.service nginx.service

Both units report active. On a fresh VM, the Nexus first-boot service does a one-time clean initialization of the embedded database and default repositories, then rotates the admin password. This takes a couple of minutes on the very first boot, before the console is reachable.

Step 5 - Retrieve the per-VM admin password

A unique administrator password is generated on the first boot of each VM and written to a root-only file. Read it over SSH:

sudo cat /root/nexus-credentials.txt

The file contains NEXUS_URL, NEXUS_ADMIN_USER (which is admin) and NEXUS_ADMIN_PASSWORD. Keep this password safe. It is the initial administrator credential for this VM.

Use the VM's public IP address in your browser. On a VM with a Standard SKU public IP (the default, and what Step 2 creates), NEXUS_URL in this file shows the VM's private address, because the first-boot service cannot read a Standard public IP from the instance metadata. Browse to the public IP shown in the Azure portal, or get it with az vm show --show-details --query publicIps -o tsv.

Step 6 - Sign in to the Nexus web console

Browse to http://<vm-public-ip>/ and choose Sign in in the top-right corner. Sign in as admin with the password from Step 5.

After you sign in, the Browse view lists the repositories that ship ready to use, including maven-central (a proxy of Maven Central), maven-releases and maven-snapshots (hosted), maven-public (a group), and the equivalent NuGet repositories.

Step 7 - Administer and create repositories

Open the Server administration and configuration (gear) menu, then Repository > Repositories, to manage existing repositories or create new ones. Choose Create repository, then pick a recipe such as npm (hosted), docker (hosted), pypi (proxy) or raw (hosted) to add a new format.

The Support > Status view under administration shows a live health summary of the node, including available CPUs, blob store quotas and file descriptor limits.

Step 8 - Point a Maven build at your repository

Configure Maven to resolve dependencies through the maven-public group on your VM by adding a mirror to ~/.m2/settings.xml on your build machine. Replace <vm-public-ip> with your VM address.

Anonymous access is disabled on this image, so an unauthenticated request to maven-public returns 401. The <servers> entry, whose <id> matches the mirror's, gives Maven the credentials. Use the admin account from Step 5 or, better, a dedicated user you create under Security > Users:

<settings> <servers> <server> <id>sac-nexus</id> <username>admin</username> <password>NEXUS_ADMIN_PASSWORD from Step 5</password> </server> </servers> <mirrors> <mirror> <id>sac-nexus</id> <name>sac Nexus</name> <url>http://<vm-public-ip>/repository/maven-public/</url> <mirrorOf>*</mirrorOf> </mirror> </mirrors> </settings>

To publish build outputs, deploy to the maven-releases or maven-snapshots hosted repositories at http://<vm-public-ip>/repository/maven-releases/ using your admin credentials (or a dedicated deployment user you create under Security > Users).

Step 9 - Verify the REST API and health endpoint

nginx serves an unauthenticated health endpoint that Azure Load Balancer probes can target, and Nexus exposes a status endpoint. Query both:

curl -s http://127.0.0.1/health
curl -s http://127.0.0.1/service/rest/v1/status -o /dev/null -w 'status endpoint HTTP %{http_code}\n'

The write-availability endpoint also answers without credentials, but credentials sent with it are checked, and a wrong password returns 401. The following command reads the per-VM password from the credentials file, so no password appears on your command line. It confirms that the per-VM password authenticates and that the instance is writable, and returns 200:

PW=$(sudo grep '^NEXUS_ADMIN_PASSWORD=' /root/nexus-credentials.txt | cut -d= -f2-)
curl -s -u "admin:$PW" http://127.0.0.1/service/rest/v1/status/writable -o /dev/null -w 'writable HTTP %{http_code}\n'

For reference, the equivalent authenticated call from a remote machine is curl -u admin:<NEXUS_ADMIN_PASSWORD> http://<vm-public-ip>/service/rest/v1/status/writable, substituting the password from Step 5. A wrong password returns 401.

Step 10 - Maintenance

systemd manages Nexus and its reverse proxy. Restart or inspect them with:

sudo systemctl restart nexus.service
sudo journalctl -u nexus.service --no-pager | tail -n 20

All repository data, the embedded database and the search index live under /var/lib/nexus on the dedicated data disk, so they survive OS patching and can be resized independently. The application log is at /var/lib/nexus/log/nexus.log.

Anonymous access is disabled by default. To allow unauthenticated read of public repositories, enable it under Security > Anonymous Access. Because Nexus serves plain HTTP on port 80, place it behind TLS with your own domain before you run it in production.

Support

SecureAnyCloud maintains this image and provides 24/7 support. For help, contact sales@secureanycloud.com.

Deploy on Azure

Launch Sonatype Nexus Repository OSS on Ubuntu 24.04 LTS on Azure with 24/7 support from SecureAnyCloud.

View this image

Need Help?

Our support team is available 24/7.

sales@secureanycloud.com

Deploy on Azure