How to setup sonatype nexus 3 repository manager using docker

ag
3 min readJul 24, 2020

--

Today we will be setting up nexus repository manager using docker

Nexus repository manager

Prerequisites:

Creating and running the container

First, we will start by creating a volume to keep the data persistent in case the container stops for any reason

docker volume create --name nexus-data

next, we are going to run the container with the sonatype/nexus3 image

docker run -d -p 8081:8081 --name nexus -v nexus-data:/nexus-data sonatype/nexus3

by default, nexus repository manager runs on port 8081

Now, we will give it a minute or two to initialize

Now by visiting the url, we can see that nexus has initialized

Using chrome to check if nexus is running

We can also test this using curl

Using curl to check if nexus is running

The next step we need to do is get the admin password which is auto generated on the initial launch of the container.

As stated in the documentation, Default user is admin and the uniquely generated password can be found in the admin.password file inside the volume.

Getting the admin password

We will cat the password out to our console by using docker exe

docker container exec nexus cat nexus-data/admin.password

which should return something like the following

Where efecafa7–767a-4260–8fff-7d202decce80 is the password

Now we are able to login into nexus’s admin panel

and from there, we can setup nexus and create different repositories according to our need.

Feel free to check out my other articles and my blog

If you found this article any useful, you know what to do now. Hit that clap button and follow me to get more articles on your feed.

--

--