Nexus
Sonatype Nexus Repository is an artifact and package repository manager for storing and proxying binaries such as Maven, npm, NuGet, Docker, and PyPI components. It gives your build pipelines a single, reliable source for dependencies and release artifacts. The web UI runs on port 8081.
Software included
Section titled “Software included”| Component | Version |
|---|---|
| Nexus Repository | 3.94.0 |
| Ubuntu | 24.04 LTS |
Environment variables
Section titled “Environment variables”Set these optionally when you deploy from the marketplace. Leave a field blank to have a secure value generated.
| Variable | Description |
|---|---|
NEXUS_ADMIN_PASSWORD | Nexus admin password |
Getting started
Section titled “Getting started”1. Connect to your VM
Section titled “1. Connect to your VM”ssh ubuntu@<your-vm-ip>2. Wait for first-boot configuration
Section titled “2. Wait for first-boot configuration”Nexus starts from its pre-installed Docker image and generates a unique initial admin password. Initialization can take several minutes. Track progress with:
sudo journalctl -u nexus-first-boot.service -fThen verify the container:
cd /opt/nexus && docker compose ps3. Access the Nexus UI
Section titled “3. Access the Nexus UI”Open a browser and navigate to:
http://<your-vm-ip>:8081Read the generated login details:
sudo cat /etc/nexus/credentials.txt| Field | Value |
|---|---|
| Username | admin |
| Password | From /etc/nexus/credentials.txt |
Complete the setup wizard, change the admin password, and choose your anonymous-access policy.
Managing Nexus
Section titled “Managing Nexus”Nexus runs as a Docker Compose stack in /opt/nexus.
# Check statuscd /opt/nexus && docker compose ps
# Restartcd /opt/nexus && docker compose restart
# View logscd /opt/nexus && docker compose logs -f| Path | Purpose |
|---|---|
/opt/nexus/docker-compose.yml | Compose stack |
/var/lib/nexus/ | Persistent repository data |
/var/lib/nexus/admin.password | Initial password generated by Nexus |
/etc/nexus/credentials.txt | First-login details |
Security
Section titled “Security”Port 8081 is open on the VM’s network interface. UFW is enabled and allows Nexus (port 8081) and SSH (port 22).
To restrict the UI and repository API to a specific IP:
sudo ufw delete allow 8081/tcpsudo ufw allow from <trusted-ip> to any port 8081To access Nexus without leaving port 8081 open, use an SSH tunnel:
First close the public port on the VM, since it is open by default:
sudo ufw delete allow 8081/tcp# Run this on your local machinessh -L 8081:localhost:8081 ubuntu@<your-vm-ip>
# Then open in a browserhttp://localhost:8081For production use, place Nexus behind a reverse proxy with a trusted TLS certificate and restrict direct access to administrator and CI/CD networks.