Installation of Nexus

To install Sonatype Nexus as a Docker container, you can follow these steps:

  1. Install Docker: Ensure that Docker is installed on your system. You can download and install Docker from the official Docker website (https://www.docker.com/get-started).

  2. Pull the Nexus Docker image: Open a terminal or command prompt and execute the following command to pull the Nexus Docker image from Docker Hub:

    docker pull sonatype/nexus3

    This command will download the latest version of the Nexus 3 Docker image.

  3. Run the Nexus container: Once the image is pulled, run the Nexus container using the following command:

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

    This command starts the Nexus container in detached mode (-d) and maps port 8081 from the container to the host machine (-p 8081:8081). It also sets the container name as "nexus" using the --name flag.

  4. Wait for Nexus to start: It may take a few moments for the Nexus container to start up. You can monitor the container's logs by running the following command:

    docker logs -f nexus

    Wait until you see a log line indicating that Nexus has started successfully. You should see a message similar to: "Started Sonatype Nexus OSS 3.x.x-xx".

  5. Access Nexus web interface: Once Nexus is up and running, you can access the Nexus web interface by opening a web browser and navigating to http://localhost:8081. This will take you to the Nexus login page.

  6. Log in to Nexus: Initially, you need to obtain the Nexus administration password. Run the following command to retrieve it:

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

    The output will display the administration password. Use this password to log in to the Nexus web interface.

  7. Configure Nexus: Upon logging in for the first time, you will be prompted to change the administration password and configure additional settings according to your requirements.

Last updated