Skip to main content
Version: 0.5.3

Nexus Repository on Aruba Cloud

Deploy Sonatype Nexus Repository OSS — a universal artifact registry supporting Maven, npm, Docker, PyPI, RubyGems, and more — on Aruba Cloud using Terraform and cloud-init.

Provider version: arubacloud/arubacloud ~> 1.0 | Terraform: ≥ 1.9


Introduction​

Nexus Repository OSS is the most widely-deployed open-source artifact manager. It runs on the JVM with an embedded database and requires no external database. This example deploys:

  • Nexus Repository OSS via the official Docker image on a CSO4A8 VM
  • Persistent artifact storage on /opt/nexus-data (host volume)
  • Web UI and API on port 8081
  • Optional Docker registry on port 8082 (enable_docker_registry = true)
  • Auto-generated admin password retrieved after bootstrap

JVM startup: Nexus takes 2–3 minutes to start. The cloud-init health-check waits automatically.


Architecture Overview​


Infrastructure Created​

ResourceName patternDescription
arubacloud_projectnexus-prodProject container
arubacloud_vpcnexus-prod-vpcVirtual Private Cloud
arubacloud_subnetnexus-prod-subnetBasic subnet
arubacloud_securitygroupnexus-prod-vm-sgSecurity group
arubacloud_securityrulenexus-prod-vm-sshSSH ingress (22)
arubacloud_securityrulenexus-prod-vm-httpNexus web UI ingress (8081)
arubacloud_securityrulenexus-prod-vm-dockerDocker registry ingress (8082, optional)
arubacloud_elasticipnexus-prod-vm-eipVM public IP
arubacloud_blockstoragenexus-prod-boot100 GB boot disk (Performance)
arubacloud_keypairnexus-prod-keypairSSH public key
arubacloud_cloudservernexus-prod-vmCloudServer VM

Estimated Monthly Cost​

ResourceSpecEst. cost/mo
CloudServer VMCSO4A8 — 4 vCPU / 8 GB~€40
Boot disk100 GB Performance~€15
Elastic IP—~€3
Total~€58/mo

Variables​

Required​

VariableDescription
arubacloud_client_idArubaCloud OAuth2 client ID
arubacloud_client_secretArubaCloud OAuth2 client secret

Optional​

VariableDefaultDescription
ssh_public_keyproject owner keySSH public key content
app_name"nexus"Short name used in resource names
environment"prod"Environment label
location"ITBG-Bergamo"ArubaCloud region
zone"ITBG-1"Availability zone
billing_period"Hour""Hour" or "Month"
vm_flavor"CSO4A8"CloudServer flavor (min 4 GB RAM for JVM)
vm_disk_size_gb100Boot disk size in GB (min 50)
ssh_cidr"0.0.0.0/0"CIDR for SSH access
nexus_version"latest"Nexus Docker image tag
enable_docker_registryfalseOpen port 8082 for Docker registry

Outputs​

OutputDescription
nexus_urlNexus web UI URL
nexus_docker_registry_urlDocker registry URL (when enabled)
vm_public_ipPublic IP of the VM
ssh_commandSSH command to connect
admin_password_commandCommand to retrieve the auto-generated admin password

Deployment Instructions​

1. Clone and navigate​

git clone https://github.com/arubacloud/terraform-arubacloud-examples.git
cd terraform-arubacloud-examples/nexus

2. Configure variables​

cp terraform.tfvars.example terraform.tfvars

3. Deploy​

terraform init
terraform plan
terraform apply

Bootstrap takes approximately 3–5 minutes (JVM startup).

4. Retrieve the admin password​

ssh ubuntu@<vm_public_ip> 'docker exec nexus cat /nexus-data/admin.password'

Or use the admin_password_command Terraform output.

5. First login​

Navigate to http://<vm_public_ip>:8081, log in with admin and the retrieved password, then complete the setup wizard. The admin.password file is automatically deleted after the first login.


Enabling the Docker Registry​

Set enable_docker_registry = true in terraform.tfvars, then re-apply. After apply:

  1. Log in to Nexus web UI
  2. Create a new hosted repository of type docker (hosted) on HTTP port 8082
  3. Push images: docker push <vm_ip>:8082/myimage:tag

References​