Jenkins LTS on Ubuntu 26.04 on Azure User Guide
Overview
This image runs Jenkins LTS 2.580.3 on Ubuntu 26.04 LTS with OpenJDK 25 from Ubuntu's own archive. Jenkins comes from the official Jenkins Debian stable repository (pkg.jenkins.io/debian-stable), so apt keeps it on the LTS line. nginx answers on port 80 and passes requests to Jenkins, which listens on the virtual machine's loopback address (127.0.0.1:8080) only; websocket upgrades for agents and the CLI are already configured.
The setup wizard is completed for you. On the first boot of every virtual machine a unique administrator password is created and written to /etc/cloudimg-credentials.txt, readable by root only. Jenkins does not start until that first boot has written the password, so there is never a moment when your Jenkins accepts a default or shared login.
The image also ships with:
- Anonymous access turned off: every page except the sign-in page needs a login
- The Jenkins URL set to your virtual machine's public IP address, and one command (
sudo cloudimg-set-public-address <your-domain>, step 7) to move it to your own DNS name - Ubuntu's unattended security upgrades switched on
No plugins are preinstalled, so you choose exactly what runs on your controller. The default operating system user is the administrator account you choose when you create the virtual machine (azureuser in the examples below). The Jenkins administrator user is admin.
Prerequisites
- A Microsoft Azure subscription in which you can create resource groups, virtual networks and virtual machines
- An SSH key pair for the administrator account
- A network security group that allows inbound TCP 22 from your own network, and TCP 80 (and 443 once you add a certificate) from your users
- The Azure CLI (
az) if you deploy from the command line
The recommended size is Standard_B2ms (2 vCPUs, 8 GiB memory) for a small team. For many concurrent builds on the controller choose a Standard_D4s_v6 or larger, or better, add build agents (step 8).
Step 1: Deploy the Virtual Machine
Option A: the Azure Portal
- Sign in to the Azure Portal, open Marketplace, search for Jenkins LTS on Ubuntu 26.04 by cloudimg and select Create.
- On Basics choose your subscription, a resource group, a region and a name, and pick Standard_B2ms or larger. Under Administrator account choose SSH public key and enter your user name and key.
- Under Inbound port rules allow SSH (22) and HTTP (80). Limit SSH to your own address on the Networking tab afterwards if you can.
- Select Review + create, then Create.
First boot finishes a minute or two after the virtual machine shows Running, once Jenkins has started for the first time.
Option B: the Azure CLI
Accept the Marketplace terms once per subscription, then create the virtual machine. Replace <your-mgmt-cidr> with the network you connect from, for example 203.0.113.0/24.
az vm image terms accept --urn cloudimg1647283583153:jenkins-ubuntu-26-04:default:latest
RG=jenkins-rg
az group create --name $RG --location eastus
az vm create \
--resource-group $RG \
--name jenkins-01 \
--image cloudimg1647283583153:jenkins-ubuntu-26-04:default:latest \
--size Standard_B2ms \
--admin-username azureuser \
--ssh-key-values ~/.ssh/id_rsa.pub \
--public-ip-sku Standard \
--nsg-rule NONE
az vm open-port --resource-group $RG --name jenkins-01 --port 80 --priority 1010
az network nsg rule create --resource-group $RG --nsg-name jenkins-01NSG \
--name AllowSSHFromMgmt --priority 1000 --access Allow --protocol Tcp \
--direction Inbound --source-address-prefixes <your-mgmt-cidr> --destination-port-ranges 22
Step 2: Connect to the Virtual Machine
Find the public IP address, then connect over SSH:
az vm show --resource-group jenkins-rg --name jenkins-01 --show-details --query publicIps -o tsv
ssh azureuser@<public-ip>
Check that the services are running, which versions you have, and that Jenkins answers:
systemctl is-active jenkins nginx
test -f /var/lib/cloudimg/jenkins-firstboot.done && echo 'first boot finished'
dpkg-query -W -f='jenkins ${Version}\n' jenkins
java -version 2>&1 | head -2; nginx -v
curl -s -o /dev/null -w 'login page %{http_code}\n' http://127.0.0.1/login
active
active
first boot finished
jenkins 2.580.3
openjdk version "25.0.5.1" 2026-11-17
OpenJDK Runtime Environment (build 25.0.5.1+2-1-26.04.1-Ubuntu)
nginx version: nginx/1.28.3 (Ubuntu)
login page 200

Step 3: Read the Administrator Password
sudo cat /etc/cloudimg-credentials.txt
sudo stat -c '%a %U:%G %n' /etc/cloudimg-credentials.txt /etc/jenkins/admin-password.txt
# Jenkins LTS — Per-VM Credentials
# Generated: Tue Dec 1 21:28:56 UTC 2026
JENKINS_URL=http://<public-ip>/
JENKINS_ADMIN_USER=admin
JENKINS_ADMIN_PASSWORD=******************************** (unique to this VM)
600 root:root /etc/cloudimg-credentials.txt
640 root:jenkins /etc/jenkins/admin-password.txt
Your file shows your virtual machine's address and its real password; it is masked here.

Keep JENKINS_ADMIN_PASSWORD for the next step. Once you have changed the password in Jenkins (step 6) you can delete this file.
Step 4: Sign In to Jenkins
Browse to http://<public-ip>/. Jenkins sends you to its sign-in page; enter admin and the password from step 3.

Step 5: Run Your First Build
- Select New Item, type a name such as
hello-cloudimg, choose Freestyle project and select OK. - Under Build Steps choose Add build step, then Execute shell, and enter:
text
echo "Hello from Jenkins on Ubuntu 26.04"
java -version 2>&1 | head -1
uname -sr
- Select Save, then Build Now. The build appears under Builds; when it turns green, open it and select Console Output.


Pipelines (Jenkinsfile), Git checkouts and most integrations come from plugins: install them under Manage Jenkins > Plugins > Available plugins (for example Pipeline, Git and Credentials Binding).

Step 6: Check the Security Settings
Jenkins listens on the loopback address only; nginx is the only way in from the network, and anonymous and default logins are refused:
sudo ss -tlnH | awk '{print $4}' | sort -u
curl -s -o /dev/null -w 'anonymous /api/json %{http_code}\n' http://127.0.0.1/api/json
curl -s -o /dev/null -w 'admin:admin /api/json %{http_code}\n' -u admin:admin http://127.0.0.1/api/json
systemctl cat jenkins | grep -E '^ConditionPathExists'
0.0.0.0:22
0.0.0.0:80
127.0.0.53%lo:53
127.0.0.54:53
[::]:22
[::]:80
[::ffff:127.0.0.1]:8080
anonymous /api/json 403
admin:admin /api/json 401
ConditionPathExists=/etc/jenkins/.bootstrap-ready
Jenkins (127.0.0.1:8080) is reachable only through nginx, and its inbound TCP agent port is off: agents connect over websocket through port 80. The last line is the setting that keeps Jenkins from starting before first boot has written your password.

Change the administrator password in Jenkins under admin (top right) > Security, and create an account for each person under Manage Jenkins > Users. For per job permissions, install the Matrix Authorization Strategy plugin and switch to it under Manage Jenkins > Security.
You can call the REST API with the administrator user; for scripts, create an API token under admin > Security > API Token rather than using the password:
PASS=$(sudo grep '^JENKINS_ADMIN_PASSWORD=' /etc/cloudimg-credentials.txt | cut -d= -f2-)
curl -s -u "admin:${PASS}" http://127.0.0.1/api/json | python3 -c 'import json,sys; d=json.load(sys.stdin); print("mode:", d["mode"], "| executors:", d["numExecutors"], "| security on:", d["useSecurity"], "| jobs:", len(d["jobs"]))'
curl -sI -u "admin:${PASS}" http://127.0.0.1/api/json | grep -i '^x-jenkins:'
mode: NORMAL | executors: 2 | security on: True | jobs: 0
X-Jenkins: 2.580.3
Step 7: Use Your Own Domain and HTTPS
Point a DNS record at the virtual machine's public IP address, then tell the image about it. This updates the Jenkins URL and the credentials file and restarts Jenkins:
sudo cloudimg-set-public-address <your-domain>
Add a free Let's Encrypt certificate to nginx, after opening TCP 443 in the network security group:
sudo apt-get install -y certbot python3-certbot-nginx
sudo certbot --nginx -d <your-domain> -m <your-email> --agree-tos --redirect
Then set the Jenkins URL under Manage Jenkins > System to https://<your-domain>/.
Step 8: Updates, Agents and Backups
Ubuntu's unattended upgrades apply security updates every day. Jenkins itself comes from the Jenkins LTS repository, so a normal upgrade moves it to the newest LTS release:
apt-get -s -o APT::Get::Always-Include-Phased-Updates=true upgrade | grep -c '^Inst' || true
apt-cache policy jenkins | head -3
systemctl is-enabled apt-daily-upgrade.timer; apt-config dump APT::Periodic::Unattended-Upgrade
0
jenkins:
Installed: 2.580.3
Candidate: 2.580.3
enabled
APT::Periodic::Unattended-Upgrade "1";
The first line is the number of updates waiting: 0 on a freshly deployed virtual machine.

To upgrade Jenkins when you choose, run sudo apt-get update && sudo apt-get install --only-upgrade jenkins; Jenkins restarts on the new release. Keep plugins current under Manage Jenkins > Plugins > Updates.
Run builds on agents rather than on the controller: add them under Manage Jenkins > Nodes. Everything Jenkins keeps (jobs, build history, plugins, credentials) is in /var/lib/jenkins. Back it up with Jenkins stopped, for example:
sudo systemctl stop jenkins
sudo tar -czf /tmp/jenkins-home.tar.gz -C /var/lib jenkins
sudo systemctl start jenkins
Copy the archive off the virtual machine, for example to Azure Blob Storage with azcopy, or use Azure Backup for the whole virtual machine.
Files and Services
| What | Where |
|---|---|
| Jenkins home (jobs, plugins, credentials) | /var/lib/jenkins |
| Jenkins service settings | /etc/systemd/system/jenkins.service.d/cloudimg-overrides.conf |
| Administrator created on the first Jenkins start | /var/lib/jenkins/init.groovy.d/cloudimg-init.groovy, from /etc/jenkins/admin-password.txt |
| nginx site | /etc/nginx/sites-available/jenkins |
| Credentials file | /etc/cloudimg-credentials.txt (root only) |
| First boot | jenkins-firstboot.service, log in /var/log/jenkins-firstboot.log |
/etc/jenkins/admin-password.txt is used once, on Jenkins's first start, to create admin; after that Jenkins never reads it again, so a password, user or security setting you change in Jenkins stays as you set it. Once you have changed the password you can delete that file and the credentials file.
Support
cloudimg's support team is on hand 24 hours a day by email at support@cloudimg.co.uk, with a guaranteed response within 24 hours. Include your subscription ID, the virtual machine name and a short description of the issue.