Originally published on 2016-02-23; fully revised and updated.
This guide helps DevOps engineers quickly run Sonatype Nexus Repository Manager in Docker using the command patterns from the original post, then validate startup and access. It also highlights where those historical commands may no longer match current Nexus/Docker image behavior.
Scope and prerequisites
The original article is a command-focused quick start for RM2 and RM3. Before running anything below, ensure Docker Engine is installed (the original post linked this guide: Docker install and configuration).
- A host with Docker Engine installed and running.
- Port 8081 available on the host.
- Terminal access with permission to run Docker commands.
- Awareness that RM2-era endpoints and image tags may differ from current releases.
Installation and validation workflow
flowchart TD
A[Install Docker Engine] --> B[Choose Nexus version]
B --> C[RM2 pull image]
B --> D[RM3 clone and build image]
C --> E[Run container on port 8081]
D --> E
E --> F[Check container logs]
F --> G[Run HTTP status check]
G --> H[Open Nexus web UI]
H --> I[Login and harden credentials]
Nexus Repository Manager 2 (commands from the original post)
The RM2 flow in the original post uses the sonatype/nexus image and runs either OSS or PRO on port 8081.
# Pull image
docker pull sonatype/nexus
# Run OSS (choose one runtime command)
docker run -d -p 8081:8081 --name nexus sonatype/nexus:oss
# Run PRO (choose one runtime command)
docker run -d -p 8081:8081 --name nexus sonatype/nexus:proCode language: PHP (php)
Validate container startup
# Show the most recent container
docker ps -l
# Follow logs until Nexus is ready
docker logs -f nexus
# RM2-style status check used in the original post
curl http://localhost:8081/nexus/service/local/statusCode language: PHP (php)
The original post also uses this UI URL: http://localhost:8081/nexus/. It notes startup can take around 2–3 minutes in a new container.
Nexus Repository Manager 3 (historical build flow from the original post)
For RM3, the original article points to building images from the Sonatype Docker repo: https://github.com/sonatype/docker-nexus3.
git clone https://github.com/sonatype/docker-nexus3
cd docker-nexus3
# Build OSS image
docker build --rm --tag sonatype/nexus oss/
# Build PRO image
docker build --rm --tag sonatype/nexus:pro pro/
# Run one image
docker run -d -p 8081:8081 --name nexus sonatype/nexus:ossCode language: PHP (php)
Important: the RM3 section in the original post repeats RM2-style run/test URLs. Treat these as historical examples and verify current health endpoints, context paths, and tags in official docs before production rollout.
RM2 vs RM3 command comparison (as written in the original article)
| Area | RM2 in original post | RM3 in original post | Notes |
|---|---|---|---|
| Image source | docker pull sonatype/nexus | git clone then docker build | Build repo layout and tags may have changed since 2016. |
| Run OSS | docker run -d -p 8081:8081 --name nexus sonatype/nexus:oss | Same command repeated | Tag naming/availability should be revalidated. |
| Run PRO | docker run -d -p 8081:8081 --name nexus sonatype/nexus:pro | Same command repeated | PRO usage depends on valid licensing. |
| Status check | curl http://localhost:8081/nexus/service/local/status | Same command repeated | This is an RM2-style endpoint; verify RM3 equivalent. |
| Web URL | http://localhost:8081/nexus/ | Same URL repeated | Context path can differ by version/image configuration. |
Operational notes captured from the original post
- Default credentials listed: admin / admin123.
- Installation path listed:
/opt/sonatype/nexus. - Properties path listed:
/opt/sonatype/nexus/conf/nexus.properties. - The post notes some parameters can be overridden in JVM invocation.
References
- Original Docker install link used in the post: http://www.devopsschool.com/tutorial/docker/docker-install-and-configuration.html
- Docker Hub reference from the post: https://hub.docker.com/r/sonatype/nexus/
- RM3 repository referenced by the post: https://github.com/sonatype/docker-nexus3
Best practices and common pitfalls
- Do not assume 2016 image tags and endpoints are still valid; confirm current official documentation first.
- Change default credentials immediately after first login.
- Use container logs and explicit HTTP checks before declaring service readiness.
- Validate context path and API endpoints for your exact Nexus major version (RM2 vs RM3).
I’m Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms.
I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.
Find Trusted Cardiac Hospitals
Compare heart hospitals by city and services — all in one place.
Explore Hospitals