Deployment guide

Apache Archiva

Overview

Apache Archiva is a repository manager for the binary artifacts that your builds produce and consume. It stores and serves Maven (and other) repositories, and it can proxy and cache remote repositories such as Maven Central. Your CI fleet then pulls dependencies from a single fast local mirror.

The SecureAnyCloud image installs Apache Archiva 2.2.10 as a self-contained standalone distribution. A bundled Jetty servlet container serves the Archiva web application, and an embedded Apache Derby database holds the redback security store (users and roles) and the Archiva configuration. Archiva runs as a dedicated archiva service account, bound to the loopback connector behind an nginx reverse proxy on port 80. The image keeps all repository storage, the security database and the search indexes on a dedicated Azure data disk, and it generates a unique admin password on the first boot of every VM. The image is backed by 24/7 SecureAnyCloud support.

What you get:

  • Apache Archiva 2.2.10 (standalone distribution, bundled Jetty) on OpenJDK 8
  • The Archiva web console for browsing, searching, uploading and administering repositories
  • nginx on :80 as a reverse proxy to the loopback Archiva connector on 127.0.0.1:8080
  • A per-VM admin account generated on first boot and recorded in a root-only file
  • A dedicated Azure data disk at /var/lib/archiva for repository storage, the redback/Derby security database and the search indexes
  • archiva.service (running as the unprivileged archiva user) and nginx.service as systemd units, enabled and active
  • An unauthenticated /health endpoint for Azure Load Balancer health probes
  • 24/7 SecureAnyCloud support

Prerequisites

You need an active Azure subscription, an SSH key pair, and a VNet with a subnet in the target region.

Standard_B2ms (2 vCPU / 8 GiB RAM) is a reasonable starting point. Choose a larger size for larger repositories or busier proxy traffic.

Configure the network security group (NSG) to allow inbound 22/tcp from your management network and 80/tcp. Archiva serves plain HTTP on port 80, so for production, terminate TLS in front of it with your own domain.

Step 1 - Deploy from the Azure Marketplace

Sign in to the Azure Portal, choose Create a resource, search the Marketplace for Apache Archiva by SecureAnyCloud, and select Create.

On the Basics tab, pick your subscription, resource group, region and size. Under Administrator account, choose SSH public key and paste your key. Under Inbound port rules, allow SSH (22) and HTTP (80).

Review the dedicated data disk on the Disks tab, then select Review + create and Create.

Step 2 - Deploy from the Azure CLI

# Accept the Marketplace terms once per subscription (required before the first CLI deploy)
az vm image terms accept --urn sac1647283583153:apache-archiva-ubuntu-24-04:default:latest
az vm create \
  --resource-group <your-rg> \
  --name archiva \
  --image sac1647283583153:apache-archiva-ubuntu-24-04:default:latest \
  --size Standard_B2ms \
  --admin-username azureuser \
  --ssh-key-values ~/.ssh/id_ed25519.pub \
  --vnet-name <your-vnet> --subnet <your-subnet> \
  --public-ip-sku Standard
az vm open-port --resource-group <your-rg> --name archiva --port 80 --priority 1010

Step 3 - Connect to your VM

ssh azureuser@<vm-public-ip>

Step 4 - Confirm the services are running

systemctl is-active archiva.service nginx.service

Both services report active. Archiva runs as the dedicated archiva user and listens on the loopback connector 127.0.0.1:8080. nginx fronts it on port 80. All repository storage, the redback/Derby security database and the search indexes live on the dedicated Azure data disk mounted at /var/lib/archiva.

Step 5 - Retrieve your admin password

The first boot of your VM generates a unique Archiva admin password and writes it to a root-only file. Read the file:

sudo cat /root/archiva-credentials.txt

This file contains ARCHIVA_ADMIN_USER (admin) and ARCHIVA_ADMIN_PASSWORD, along with the Archiva URL. Store the password somewhere safe.

Step 6 - Confirm the health endpoint

nginx serves an unauthenticated health endpoint for load balancers and probes:

curl -s http://localhost/health

It returns ok. This endpoint never requires authentication, so you can safely use it for an Azure Load Balancer health probe.

Step 7 - Sign in to the Archiva web console

Browse to http://<vm-public-ip>/ and choose Login in the top-right corner. Sign in as admin with the password from Step 5.

After you sign in, use the Browse view (under Artifacts) to walk the group, artifact and version hierarchy of your managed repositories.

Use the Search view to find artifacts by coordinates or class name across every repository Archiva manages.

Under Administration -> Repositories, manage the bundled managed repositories (internal, snapshots) and add proxy connectors to remote repositories such as Maven Central.

Step 8 - Verify admin authentication from the command line

Archiva's redback REST API rejects a wrong password and returns the admin user record for the per-VM password. Read the password from the credentials file first, then call the login service. Because the command embeds your unique password, run it interactively rather than from a script. Substitute the value of ARCHIVA_ADMIN_PASSWORD from Step 5 for <ARCHIVA_ADMIN_PASSWORD>:

RB=http://127.0.0.1:8080/restServices/redbackServices; curl -s -X POST -H 'Content-Type: application/json' --data '{"username":"admin","password":"<ARCHIVA_ADMIN_PASSWORD>"}' $RB/loginService/logIn

The response is a JSON object beginning {"username":"admin",...}. A wrong password returns an error body with no username field.

Step 9 - Point Maven at your Archiva repositories

Archiva exposes each managed repository under http://<vm-public-ip>/repository/<id>/. To resolve dependencies through Archiva's proxy of Maven Central, add a mirror to your ~/.m2/settings.xml:

<settings> <mirrors> <mirror> <id>archiva-internal</id> <name>sac Archiva</name> <url>http://<vm-public-ip>/repository/internal/</url> <mirrorOf>*</mirrorOf> </mirror> </mirrors> </settings>

To deploy your own compiled outputs, add distributionManagement pointing at the internal (releases) and snapshots repositories, and a matching <server> credential entry in settings.xml using the admin account (or a dedicated deployment user you create under Administration -> Users).

Step 10 - Confirm repository data lives on the dedicated disk

Archiva's appserver.base holds the managed repositories, the redback/Derby security database, the search indexes, the configuration and the logs. It is stored on the dedicated Azure data disk, so it survives OS changes and you can resize it independently:

findmnt /var/lib/archiva

The mount is backed by a separate Azure data disk captured into the image and re-provisioned on every VM.

Maintenance

  • Users and roles: add or rotate accounts under Administration -> Users in the web console, or via the redback REST API.
  • Repositories: create managed repositories and proxy connectors under Administration -> Repositories and Proxy Connectors.
  • Storage: managed repositories, the Derby security database and the search indexes live under /var/lib/archiva on the data disk; back up that volume to protect your artifacts and configuration.
  • Logs: Archiva logs are under /var/lib/archiva/logs on the data disk.
  • Tuning: edit the JVM heap (-Xms / -Xmx) in the archiva.service unit (/etc/systemd/system/archiva.service), then sudo systemctl daemon-reload && sudo systemctl restart archiva.
  • TLS: Archiva serves plain HTTP on port 80; front it with TLS (for example, certbot) and your own domain before running it in production.
  • Security patches: unattended-upgrades stays enabled, so the OS continues to receive security updates automatically.

Support

SecureAnyCloud provides 24/7 expert support for this image. Contact sales@secureanycloud.com.

Deploy on Azure

Launch Apache Archiva on Ubuntu 24.04 LTS on Azure with 24/7 support from SecureAnyCloud.

View this image

Need Help?

Our support team is available 24/7.

sales@secureanycloud.com

Deploy on Azure