How to Set Up Nexus Repository Manager on Windows Server 2025

Sonatype Nexus Repository Manager OSS is the industry-standard artifact repository, giving your organisation a centralised proxy and hosting layer for Maven, NuGet, npm, PyPI, Docker, and dozens of other package formats. Running Nexus on Windows Server 2025 lets your build agents resolve dependencies from your own network instead of hitting the public internet on every build, speeds up CI pipelines dramatically, and lets you enforce which public packages your teams are allowed to consume. This guide walks through installing the Java prerequisite, deploying Nexus, registering it as a Windows service, performing initial setup through the web UI, and wiring up NuGet, Maven, npm, and pip to use Nexus as their registry.

Prerequisites

  • Windows Server 2025 (Standard or Datacenter), fully patched
  • Local administrator account or a dedicated service account with local admin rights
  • At minimum 4 vCPUs and 8 GB RAM; 16 GB recommended for production
  • At least 100 GB of free disk on a data volume (separate from the OS drive)
  • Java 17 or Java 21 JRE/JDK (Temurin/Eclipse Adoptium recommended) — Nexus 3.x requires Java 8 minimum but recommends Java 17+
  • PowerShell 5.1 or PowerShell 7.x
  • Port 8081 open in Windows Firewall (or your chosen port)

Step 1: Install Java 17 (Temurin)

Nexus Repository Manager is a Java application, so the JRE must be installed before Nexus starts. Download Eclipse Temurin 17 from Adoptium and install silently:

# Download Temurin 17 LTS MSI
$javaUri = "https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.10%2B7/OpenJDK17U-jre_x64_windows_hotspot_17.0.10_7.msi"
Invoke-WebRequest -Uri $javaUri -OutFile "C:Temptemurin17.msi"

# Install silently
msiexec.exe /i "C:Temptemurin17.msi" /qn ADDLOCAL=FeatureMain,FeatureEnvironment,FeatureJarFileRunWith,FeatureJavaHome

# Verify
java -version

If the PATH is not updated in the current session, open a new PowerShell window or run refreshenv (if Chocolatey is installed) or manually set JAVA_HOME:

[System.Environment]::SetEnvironmentVariable("JAVA_HOME", "C:Program FilesEclipse Adoptiumjre-17.0.10.7-hotspot", "Machine")
$env:Path += ";$env:JAVA_HOMEbin"

Step 2: Download and Extract Nexus Repository Manager

Download the latest Nexus 3 Windows bundle from Sonatype. As of early 2026 the package is named nexus-3.x.y-win64.zip. Always check Sonatype’s download page for the current version.

# Create directories
New-Item -ItemType Directory -Path "D:Nexusapp" -Force
New-Item -ItemType Directory -Path "D:Nexusdata" -Force

# Download (replace version number as needed)
$nexusZip = "https://download.sonatype.com/nexus/3/nexus-3.68.0-04-win64.zip"
Invoke-WebRequest -Uri $nexusZip -OutFile "D:Nexusnexus-3.68.0-04-win64.zip"

# Extract
Expand-Archive -Path "D:Nexusnexus-3.68.0-04-win64.zip" -DestinationPath "D:Nexusapp"

# List extracted contents — you will see nexus-3.x.y-04 and sonatype-work
Get-ChildItem "D:Nexusapp"

Move the sonatype-work directory to the dedicated data volume so it is not mixed with the application binaries:

Move-Item "D:Nexusappsonatype-work" "D:Nexusdatasonatype-work"

Step 3: Configure nexus-default.properties

The primary configuration file is located at <nexus-install>etcnexus-default.properties. Open it and adjust the following values:

notepad "D:Nexusappnexus-3.68.0-04etcnexus-default.properties"

Key settings to review or change:

# TCP port Nexus listens on (default 8081)
application-port=8081

# Context path — leave as / unless reverse-proxied under a subpath
nexus-context-path=/

# Point to your external data directory
nexus-work=D:/Nexus/data/sonatype-work/nexus3

Also open binnexus.vmoptions to tune JVM heap. For an 8 GB server a reasonable starting point is:

-Xms2703m
-Xmx2703m
-XX:MaxDirectMemorySize=2703m

Step 4: Install and Start Nexus as a Windows Service

Nexus bundles a service wrapper executable. Open an elevated PowerShell window and run:

# Navigate to the bin directory
Set-Location "D:Nexusappnexus-3.68.0-04bin"

# Install the service
.nexus.exe /install

# Start the service
.nexus.exe /start

# Verify the service is running
Get-Service -Name nexus | Select-Object Name, Status, StartType

Set the service to start automatically and configure recovery actions:

Set-Service -Name nexus -StartupType Automatic

# Configure failure actions: restart after 60 seconds, three times
sc.exe failure nexus reset= 86400 actions= restart/60000/restart/60000/restart/60000

Step 5: Open the Firewall and Verify the Web UI

# Add inbound firewall rule for Nexus
New-NetFirewallRule `
  -DisplayName "Nexus Repository Manager" `
  -Direction Inbound `
  -Protocol TCP `
  -LocalPort 8081 `
  -Action Allow `
  -Profile Domain,Private

Open a browser and navigate to http://<server-ip>:8081. Nexus takes 1–2 minutes to initialise on first launch. Once the UI appears, click Sign In. The first-run admin password is written to a file:

Get-Content "D:Nexusdatasonatype-worknexus3admin.password"

Use that password to log in as admin, then the setup wizard prompts you to change it and configure anonymous access.

Step 6: Create a NuGet Hosted and Proxy Repository

In the Nexus UI go to Administration → Repository → Repositories → Create repository.

  • nuget (hosted): Format = NuGet, Name = nuget-internal, Deployment policy = Allow Redeploy for dev, Disable Redeploy for production.
  • nuget (proxy): Format = NuGet, Name = nuget-proxy, Remote storage = https://api.nuget.org/v3/index.json.
  • nuget (group): Format = NuGet, Name = nuget-group, Member repositories = nuget-proxy + nuget-internal.

To push a package to the hosted repository, generate an API key under your user profile in Nexus, then:

# Register Nexus as a NuGet source
nuget sources add -Name NexusInternal `
  -Source "http://buildserver:8081/repository/nuget-group/index.json" `
  -Username admin -Password YourAdminPass

# Push a package
nuget push MyPackage.1.0.0.nupkg `
  -Source NexusInternal `
  -ApiKey YOUR_NEXUS_API_KEY

Step 7: Create Maven Hosted and Proxy Repositories

Create a maven2 (hosted) repository named maven-releases with Version Policy = Release, and a maven2 (proxy) named maven-central with Remote storage = https://repo1.maven.org/maven2/. Then update your project’s settings.xml:

<settings>
  <mirrors>
    <mirror>
      <id>nexus</id>
      <mirrorOf>*</mirrorOf>
      <url>http://buildserver:8081/repository/maven-group/</url>
    </mirror>
  </mirrors>
  <servers>
    <server>
      <id>nexus</id>
      <username>admin</username>
      <password>your-password</password>
    </server>
  </servers>
</settings>

Step 8: Configure npm and pip to Use Nexus Proxies

Create an npm (proxy) repository in Nexus pointing to https://registry.npmjs.org. Then configure npm on your developer machines or build agents:

# Set npm registry to Nexus
npm config set registry http://buildserver:8081/repository/npm-proxy/

# For private packages requiring authentication
npm config set //buildserver:8081/repository/npm-proxy/:_authToken "base64(user:pass)"

For Python/pip, create a pypi (proxy) repository in Nexus pointing to https://pypi.org, then configure pip.conf (Windows location: %APPDATA%pippip.ini):

[global]
index-url = http://buildserver:8081/repository/pypi-proxy/simple/
trusted-host = buildserver

You can also pass these settings inline during CI builds:

pip install -r requirements.txt `
  --index-url http://buildserver:8081/repository/pypi-proxy/simple/ `
  --trusted-host buildserver

Conclusion

You now have a fully operational Nexus Repository Manager running as a Windows service on Windows Server 2025, with NuGet, Maven, npm, and pip all routing through your centralised proxy. Teams can push internal packages to hosted repositories while consuming public packages through Nexus-cached proxies, reducing build times and giving you full control over which external artifacts enter your environment. For production hardening, consider placing Nexus behind an IIS or nginx reverse proxy with TLS termination, enabling LDAP authentication against Active Directory, and scheduling regular backups of the sonatype-work data directory using Windows Server Backup or a scheduled robocopy task.