The CloudSOE SonarQube image gives you a complete SonarQube stack (SonarQube Community Build with a local PostgreSQL database) on a hardened Ubuntu base, with the kernel and ulimit tuning SonarQube’s embedded Elasticsearch requires already applied. The image contains no baked-in passwords: on first boot your VM generates two separate unique passwords (one for the SonarQube admin account, one for the database) and writes them to a protected credentials file.

What you’ll need

  • An Azure subscription
  • An SSH public key (password login is disabled in the image)
  • About ten minutes

Step 1: Create the VM

  1. Find the CloudSOE SonarQube offer in the Azure Marketplace and click Create.
  2. Choose a resource group, region and VM name.
  3. Pick a size with at least 4 GB RAM, for example Standard_B2s for evaluation or Standard_D2as_v4 for steady use. SonarQube runs a web server, compute engine, Elasticsearch and PostgreSQL on one box.
  4. Under Administrator account, select SSH public key, pick a username (e.g. azureuser) and paste your key.
  5. Create or attach a public IP. For production, make it Static so your CI configuration doesn’t break across stop/start.

Step 2: Open the firewall ports

In the VM’s network security group, allow inbound:

PortProtocolPurpose
22TCPSSH administration
9000TCPSonarQube web interface

Restrict both to your own IP range (or your CI runners’ range) where possible.

Step 3: Let first boot finish

First boot runs in two one-time services. Before SonarQube starts, sonarqube-firstboot:

  • generates two distinct passwords meeting SonarQube’s password policy (one for the database, one for the admin account),
  • sets the database password on the PostgreSQL sonar role and in SonarQube’s database configuration,
  • saves both to the credentials file.

Then, once SonarQube is up, sonarqube-admin-password replaces the default admin/admin login with the generated admin password (it retries until that succeeds).

SonarQube itself takes a couple of minutes to start (Elasticsearch indexing). You can watch:

ssh <admin-user>@<public-ip>
systemctl status sonarqube-firstboot sonarqube-admin-password sonar

Step 4: Retrieve your credentials

SSH in with the admin username you chose at deployment. The login banner (MOTD) shows the URL and points at the credentials file:

cat /opt/default-sonar-login.txt

This file (mode 600) holds the generated passwords for the SonarQube admin account and the PostgreSQL sonar user. They are different passwords.

Step 5: Log in and run your first analysis

From your own machine (an Azure VM often cannot reach its own public IP from inside), browse to http://<public-ip>:9000 and sign in as admin with the generated password. Create a project (Projects → Create Project → Local project), generate a token, and point a scanner at your server from your build machine:

sonar-scanner \
  -Dsonar.host.url=http://<public-ip>:9000 \
  -Dsonar.token=<your-token>

Next steps