{"id":468,"date":"2026-10-14T15:31:14","date_gmt":"2026-10-14T15:31:14","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/2016\/02\/23\/sonatype-nexus-installation-using-docker\/"},"modified":"2026-10-14T15:31:14","modified_gmt":"2026-10-14T15:31:14","slug":"sonatype-nexus-installation-using-docker","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/sonatype-nexus-installation-using-docker\/","title":{"rendered":"Install Sonatype Nexus with Docker: RM2\/RM3 Commands, Validation Steps, and Important Caveats"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><em>Originally published on 2016-02-23; fully revised and updated.<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">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.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Scope and prerequisites<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">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: <a href=\"http:\/\/www.devopsschool.com\/tutorial\/docker\/docker-install-and-configuration.html\">Docker install and configuration<\/a>).<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>A host with Docker Engine installed and running.<\/li><li>Port <strong>8081<\/strong> available on the host.<\/li><li>Terminal access with permission to run Docker commands.<\/li><li>Awareness that RM2-era endpoints and image tags may differ from current releases.<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Installation and validation workflow<\/h2>\n\n\n\n<pre class=\"mermaid\">\nflowchart TD\n    A[Install Docker Engine] --> B[Choose Nexus version]\n    B --> C[RM2 pull image]\n    B --> D[RM3 clone and build image]\n    C --> E[Run container on port 8081]\n    D --> E\n    E --> F[Check container logs]\n    F --> G[Run HTTP status check]\n    G --> H[Open Nexus web UI]\n    H --> I[Login and harden credentials]\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Nexus Repository Manager 2 (commands from the original post)<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The RM2 flow in the original post uses the <code>sonatype\/nexus<\/code> image and runs either OSS or PRO on port 8081.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php language-bash\"><span class=\"hljs-comment\"># Pull image<\/span>\ndocker pull sonatype\/nexus\n\n<span class=\"hljs-comment\"># Run OSS (choose one runtime command)<\/span>\ndocker run -d -p <span class=\"hljs-number\">8081<\/span>:<span class=\"hljs-number\">8081<\/span> --name nexus sonatype\/nexus:oss\n\n<span class=\"hljs-comment\"># Run PRO (choose one runtime command)<\/span>\ndocker run -d -p <span class=\"hljs-number\">8081<\/span>:<span class=\"hljs-number\">8081<\/span> --name nexus sonatype\/nexus:pro<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\">Validate container startup<\/h3>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php language-bash\"><span class=\"hljs-comment\"># Show the most recent container<\/span>\ndocker ps -l\n\n<span class=\"hljs-comment\"># Follow logs until Nexus is ready<\/span>\ndocker logs -f nexus\n\n<span class=\"hljs-comment\"># RM2-style status check used in the original post<\/span>\ncurl http:<span class=\"hljs-comment\">\/\/localhost:8081\/nexus\/service\/local\/status<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">The original post also uses this UI URL: <a href=\"http:\/\/localhost:8081\/nexus\/\">http:\/\/localhost:8081\/nexus\/<\/a>. It notes startup can take around 2\u20133 minutes in a new container.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Nexus Repository Manager 3 (historical build flow from the original post)<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">For RM3, the original article points to building images from the Sonatype Docker repo: <a href=\"https:\/\/github.com\/sonatype\/docker-nexus3\">https:\/\/github.com\/sonatype\/docker-nexus3<\/a>.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php language-bash\">git <span class=\"hljs-keyword\">clone<\/span> https:<span class=\"hljs-comment\">\/\/github.com\/sonatype\/docker-nexus3<\/span>\ncd docker-nexus3\n\n<span class=\"hljs-comment\"># Build OSS image<\/span>\ndocker build --rm --tag sonatype\/nexus oss\/\n\n<span class=\"hljs-comment\"># Build PRO image<\/span>\ndocker build --rm --tag sonatype\/nexus:pro pro\/\n\n<span class=\"hljs-comment\"># Run one image<\/span>\ndocker run -d -p <span class=\"hljs-number\">8081<\/span>:<span class=\"hljs-number\">8081<\/span> --name nexus sonatype\/nexus:oss<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\"><strong>Important:<\/strong> 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.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">RM2 vs RM3 command comparison (as written in the original article)<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Area<\/th><th>RM2 in original post<\/th><th>RM3 in original post<\/th><th>Notes<\/th><\/tr><\/thead><tbody><tr><td>Image source<\/td><td><code>docker pull sonatype\/nexus<\/code><\/td><td><code>git clone<\/code> then <code>docker build<\/code><\/td><td>Build repo layout and tags may have changed since 2016.<\/td><\/tr><tr><td>Run OSS<\/td><td><code>docker run -d -p 8081:8081 --name nexus sonatype\/nexus:oss<\/code><\/td><td>Same command repeated<\/td><td>Tag naming\/availability should be revalidated.<\/td><\/tr><tr><td>Run PRO<\/td><td><code>docker run -d -p 8081:8081 --name nexus sonatype\/nexus:pro<\/code><\/td><td>Same command repeated<\/td><td>PRO usage depends on valid licensing.<\/td><\/tr><tr><td>Status check<\/td><td><code>curl http:\/\/localhost:8081\/nexus\/service\/local\/status<\/code><\/td><td>Same command repeated<\/td><td>This is an RM2-style endpoint; verify RM3 equivalent.<\/td><\/tr><tr><td>Web URL<\/td><td><code>http:\/\/localhost:8081\/nexus\/<\/code><\/td><td>Same URL repeated<\/td><td>Context path can differ by version\/image configuration.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Operational notes captured from the original post<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>Default credentials listed: <strong>admin \/ admin123<\/strong>.<\/li><li>Installation path listed: <code>\/opt\/sonatype\/nexus<\/code>.<\/li><li>Properties path listed: <code>\/opt\/sonatype\/nexus\/conf\/nexus.properties<\/code>.<\/li><li>The post notes some parameters can be overridden in JVM invocation.<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">References<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>Original Docker install link used in the post: <a href=\"http:\/\/www.devopsschool.com\/tutorial\/docker\/docker-install-and-configuration.html\">http:\/\/www.devopsschool.com\/tutorial\/docker\/docker-install-and-configuration.html<\/a><\/li><li>Docker Hub reference from the post: <a href=\"https:\/\/hub.docker.com\/r\/sonatype\/nexus\/\">https:\/\/hub.docker.com\/r\/sonatype\/nexus\/<\/a><\/li><li>RM3 repository referenced by the post: <a href=\"https:\/\/github.com\/sonatype\/docker-nexus3\">https:\/\/github.com\/sonatype\/docker-nexus3<\/a><\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Best practices and common pitfalls<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>Do not assume 2016 image tags and endpoints are still valid; confirm current official documentation first.<\/li><li>Change default credentials immediately after first login.<\/li><li>Use container logs and explicit HTTP checks before declaring service readiness.<\/li><li>Validate context path and API endpoints for your exact Nexus major version (RM2 vs RM3).<\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>A structured, production-minded rewrite of the original 2016 Docker setup for Sonatype Nexus Repository Manager 2 and 3. Includes command examples, a workflow diagram, and clear warnings about outdated tags\/endpoints.<\/p>\n","protected":false},"author":1,"featured_media":3156,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[157],"tags":[567,1122,545,237,426,1312,1313,1310,1311,593,570,732,213],"class_list":["post-468","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-sonatype-nexus","tag-docker","tag-guide","tag-how","tag-install","tag-nexus","tag-nexus-installation","tag-nexus-installation-tutorial","tag-nexus-installation-using-docker-guide","tag-nexus-installation-using-docker-tutorial","tag-process","tag-sonatype-nexus","tag-steps","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/468","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=468"}],"version-history":[{"count":6,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/468\/revisions"}],"predecessor-version":[{"id":79351,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/468\/revisions\/79351"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media\/3156"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=468"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=468"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=468"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}