Nexus is written in Java, so it's a pig for memory[1]Memory use can be adjusted by tweaking the INSTALL4J_ADD_VM_PARAMS environment variable. and runs like a dog As per the system requirements, you need:
- at least 4 CPU's
- at least 8 GB of RAM
Nexus will switch to read-only mode if the available disk space drops below 4 GB, so you need at least this much, plus space for everything else[2]In particular, the downloaded artifacts.. Check here for some sizing examples.
Running Nexus
The easist way to run Nexus is to use their Docker image[3]Check here if you want to run Nexus on a Raspberry Pi, or other ARM architecture.. We first create a directory to store its data, and since the program runs inside the container with a UID of 200, we also need to allow access to it:
sudo mkdir /var/nexus3-data sudo chown -R 200 /var/nexus3-data
Then download and run the Docker image:
docker run --detach --rm \ --publish 8081:8081 \ --volume /var/nexus3-data:/nexus-data \ --stop-timeout 120 \ --name nexus3 \ sonatype/nexus3
Nexus needs time to shutdown cleanly[4]In particular, to finalize the database., so we give the container a longer timeout when it is stopped.
Nexus is also very slow to start, so to monitor its progress:
docker logs -f nexus3
Once it's finished starting up, open a browser at nexus3:8081, and log in as admin. The password can be found in a file[5]This file will be deleted after you change the password. called admin.password, in the data directory we created above.
You will be asked to set a new admin password, and whether or not to allow anonymous access. This tutorial assumes that it has been allowed.
Browse through the repositories that Nexus creates by default, and if you like to be tidy, you can click through to each one and delete them.
References
↵1 | Memory use can be adjusted by tweaking the INSTALL4J_ADD_VM_PARAMS environment variable. |
---|---|
↵2 | In particular, the downloaded artifacts. |
↵3 | Check here if you want to run Nexus on a Raspberry Pi, or other ARM architecture. |
↵4 | In particular, to finalize the database. |
↵5 | This file will be deleted after you change the password. |