GitLab Runner on Windows Server 2025 on Azure User Guide
Overview
This guide covers the deployment and use of GitLab Runner on Windows Server 2025 on Microsoft Azure, using cloudimg's virtual machine image from the Azure Marketplace.
GitLab Runner is the open source agent (MIT licence) that runs the jobs of GitLab CI/CD pipelines. A Windows runner is how teams build and test .NET, MSVC, PowerShell and Windows installer projects on Windows itself. This image runs GitLab Runner as a Windows service with the shell executor tools it needs, PowerShell 7 and Git for Windows, and leaves it unregistered: it holds no token and talks to no GitLab server until you register it with your own runner token, from GitLab.com or your own GitLab instance.
The image is Microsoft Windows Server 2025 Datacenter with the Desktop Experience (the full graphical interface), Gen2, x64, built from Microsoft's own image on the Azure Marketplace (MicrosoftWindowsServer:WindowsServer:2025-datacenter-g2, version 26100.33828.261112). The Windows Server licence is included in the VM price and billed by Microsoft.
What's included:
- GitLab Runner 19.6.2 for Windows (64-bit), GitLab's own unmodified binary, its SHA-256 checksum verified against GitLab's published checksum list when the image was built, in
C:\Program Files\GitLab Runner\and on the machinePATH - The Windows service
gitlab-runner, set to start automatically, running under its own virtual account NT SERVICE\gitlab-runner (never LocalSystem, never an administrator) and restarted by Windows if it ever stops unexpectedly - The runner's folder
C:\GitLab-Runner(configuration, builds and cache), readable only by SYSTEM, Administrators and the runner's own account CONFIG_FILEset machine-wide toC:\GitLab-Runner\config.toml, so everygitlab-runnercommand you type, from any folder, works on the service's own configuration- Git for Windows 2.56.1.2 and PowerShell 7.6.10 LTS, both on the machine
PATH, for jobs run by the shell executor - A self-test,
C:\Program Files\GitLab Runner\gitlab-runner-selftest.ps1, that proves the runner runs a CI job with no GitLab server and nothing registered - No runner registered, no token, and nothing listening on the network: the runner only makes outbound HTTPS connections to your GitLab server once you register it. This VM's own runner system ID is made at its first boot, so no two VMs share one
- Windows Server 2025 Datacenter, Desktop Experience, version 24H2, build 26100, with Microsoft's latest cumulative update. Windows Update ran during the build and reported nothing pending when the image was captured on 3 December 2026
- The Azure VM agent, so Azure features such as Reset password and Run command work
- cloudimg's support team is on hand 24 hours a day by email (support@cloudimg.co.uk), with a guaranteed response within 24 hours
Platform: Microsoft Azure (Gen2 Hyper-V; Trusted Launch, NVMe and accelerated networking supported)
Administrator account: the user name and password you choose when you deploy the VM. There is no default Windows password on this image.
Runner configuration: C:\GitLab-Runner\config.toml
Prerequisites
- An Azure subscription
- A Remote Desktop client: Remote Desktop Connection (
mstsc) on Windows, Windows App (formerly Microsoft Remote Desktop) on macOS, or Remmina on Linux - The public IP address of the machine you will connect from, so you can allow Remote Desktop from that address only
- A GitLab account on GitLab.com or your own GitLab instance, with the Maintainer or Owner role on the project (or group) whose jobs this runner will run
Recommended size: Standard_B2ms (2 vCPUs, 8 GiB memory). For heavier builds (large .NET or C++ solutions, several jobs at once), choose a size with more vCPUs and memory.
Step 1: Deploy the Virtual Machine
Option A: Azure Portal
- In the Azure Marketplace, search for "GitLab Runner on Windows Server 2025 cloudimg"
- Select the offer and click Create
- Configure the basics:
- Subscription and Resource group: select or create
- Virtual machine name and Region: your choice
- Size:
Standard_B2msrecommended - Under Administrator account, enter a Username and a Password that you choose. Azure refuses reserved names such as "administrator", "admin" and "guest"
- Under Inbound port rules, allow RDP (3389). Azure then opens port 3389 to the whole internet, so restrict it straight after deployment (step 7)
- Click Review + create, then Create
- When the deployment finishes, open the VM's Networking (Network settings) page and edit the inbound rule for port 3389: set Source to My IP address (or your office or VPN address range)
GitLab Runner needs no inbound port: it polls your GitLab server for jobs over outbound HTTPS.
Option B: Azure CLI
Accept the offer terms once per subscription, then create the VM with no inbound rules. Leave out --admin-password and the CLI asks for the password, which keeps it out of your shell history:
az vm image terms accept --urn cloudimg1647283583153:gitlab-runner-windows-server:default:latest
az vm create \
--resource-group myResourceGroup \
--name my-gitlab-runner \
--image cloudimg1647283583153:gitlab-runner-windows-server:default:latest \
--size Standard_B2ms \
--admin-username <your-admin-name> \
--public-ip-sku Standard \
--nsg-rule NONE
Then allow Remote Desktop from your own address only, and read the VM's public IP:
az network nsg rule create \
--resource-group myResourceGroup \
--nsg-name my-gitlab-runnerNSG \
--name allow-rdp-from-my-ip \
--priority 1000 \
--direction Inbound --access Allow --protocol Tcp \
--destination-port-ranges 3389 \
--source-address-prefixes <your-public-ip>/32
az vm show --resource-group myResourceGroup --name my-gitlab-runner --show-details --query publicIps -o tsv
Step 2: Connect with Remote Desktop
- Open your Remote Desktop client and connect to the VM's public IP address
- Windows: run
mstsc, enter the IP address and click Connect - macOS: in Windows App, add a PC with the IP address
- Linux: in Remmina, create an RDP connection to the IP address
- When asked for credentials, sign in as
<vm-name>\<your-admin-name>with the password you set at deployment. On Windows, choose More choices, then Use a different account - Accept the certificate warning: the VM uses a self-signed Remote Desktop certificate
Windows may show its privacy settings screen at your first sign-in; choose your settings and click Accept.
The runner does not need you to stay signed in: it is a Windows service, running from the moment the VM starts, and the jobs it runs keep running after you disconnect.
Step 3: Check that the runner is running
At the first start of your VM, a one-time task waits for Azure to finish setting the VM up, writes the runner's configuration fresh (with no runner registered), starts the gitlab-runner service, waits for it to make this VM's own runner system ID, and removes itself. It takes about a minute after the VM is first reachable.
Open Windows PowerShell with Run as administrator (right-click the Start button, then Terminal (Admin)) and run:
Get-Content C:\ProgramData\gitlab-runner-firstboot.done
Get-CimInstance Win32_Service -Filter "Name='gitlab-runner'" | Format-Table Name, State, StartMode, StartName -AutoSize
Get-Content C:\GitLab-Runner\config.toml
$env:CONFIG_FILE
gitlab-runner list
done 2026-12-03T15:40:05.7378586Z system_id=s_5b5670a7a9ba
Name State StartMode StartName
---- ----- --------- ---------
gitlab-runner Running Auto NT SERVICE\gitlab-runner
concurrent = 1
check_interval = 0
shutdown_timeout = 0
[session_server]
session_timeout = 1800
C:\GitLab-Runner\config.toml
Runtime platform arch=amd64 os=windows pid=7560 revision=ea3e7b9e version=19.6.2
Listing configured runners ConfigFile=C:\GitLab-Runner\config.toml
The first line means the first-boot task has finished, and names this VM's runner system ID (GitLab shows it for each runner manager). The service is running, starts automatically, and runs as its own account NT SERVICE\gitlab-runner. config.toml has no [[runners]] section and gitlab-runner list lists none: nothing is registered yet.

The service is also in the Services console (services.msc), with its description and its Log On As account:

The versions of the runner and of the tools its jobs use:
gitlab-runner --version
git --version
pwsh -NoProfile -Command '$PSVersionTable.PSVersion.ToString()'
Version: 19.6.2
Git revision: ea3e7b9e
Git branch: 19-6-stable
GO version: go1.26.11
Built: 2026-12-02T20:51:15Z
OS/Arch: windows/amd64
git version 2.56.1.windows.2
7.6.10

Step 4: Run the self-test
Before you register anything, you can prove the runner runs a CI job on this VM. The self-test serves, on 127.0.0.1 at a random port and only while it runs, the three calls of GitLab's job API that a runner makes, and hands the runner one job. The job runs in PowerShell 7 and prints its Windows identity and the versions of PowerShell and Git. Nothing leaves the VM and nothing is registered. In the elevated PowerShell window:
& 'C:\Program Files\GitLab Runner\gitlab-runner-selftest.ps1'
Running with gitlab-runner 19.6.2 (ea3e7b9e)
on cloudimgr, system ID: s_5b5670a7a9ba
UUID: not supported with this GitLab version
Preparing the "shell" executor
Using Shell (pwsh) executor...
Preparing environment
Running on wsrdp-b91c9f...
Running on CPU: Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz
Getting source from Git repository
Skipping Git repository setup
Skipping Git checkout
Skipping Git submodules setup
Executing "step_script" stage of the job script
$ "job user: $([Security.Principal.WindowsIdentity]::GetCurrent().Name)"
job user: NT AUTHORITY\SYSTEM
$ "pwsh: $($PSVersionTable.PSVersion)"
pwsh: 7.6.10
$ "git: $(git --version)"
git: git version 2.56.1.windows.2
$ "marker: $env:CLOUDIMG_SELFTEST_MARKER"
marker: cloudimg-931f11786421
Cleaning up project directory and file based variables
Job succeeded
SELFTEST_OK mode=run-single user=NT AUTHORITY\SYSTEM pwsh=7.6.10 git=git version 2.56.1.windows.2
That job ran through gitlab-runner run-single, as the account that started the self-test: SYSTEM above, where it was run through Azure's Run command, and your own administrator account when you run it in your PowerShell window, as in this screenshot:

Add -ViaService to have the service take the job instead, through a temporary runner entry that the self-test adds to config.toml and removes afterwards: the job then runs as the service's own account, NT SERVICE\gitlab-runner, exactly as your pipelines' jobs will. The self-test refuses -ViaService once a runner is registered, so it never touches your configuration.
& 'C:\Program Files\GitLab Runner\gitlab-runner-selftest.ps1' -ViaService

Step 5: Create a runner in GitLab
GitLab issues the token the runner registers with. For a runner that serves one project:
- In GitLab, open the project, then Settings > CI/CD, and expand Runners
- Click New project runner
- Choose Windows as the platform
- Under Tags, enter one or more tags, for example
windows. Your jobs pick this runner with the same tags. To let it also take jobs that have no tags, tick Run untagged jobs - Optionally fill in a Runner description, then click Create runner
- GitLab shows a runner authentication token beginning
glrt-. Copy it: it is shown only on this page
For a runner shared by every project in a group, do the same from the group's Build > Runners page (New group runner). On your own GitLab instance, an administrator can also create an instance runner under Admin > CI/CD > Runners. See GitLab's runner registration documentation for every option.
Step 6: Register the runner
Back on the VM, in the elevated PowerShell window, register the runner with the shell executor and PowerShell 7. Paste your token when PowerShell asks for it, so it never appears in your command history. For GitLab.com the URL is https://gitlab.com; for your own instance, use its address:
$token = [Net.NetworkCredential]::new('', (Read-Host 'Runner authentication token (glrt-...)' -AsSecureString)).Password
gitlab-runner register --non-interactive --url https://gitlab.com --token $token --executor shell --shell pwsh --name $env:COMPUTERNAME
Remove-Variable token
The options register takes for this, from the runner itself (the screenshot also shows gitlab-runner list and the empty configuration before registering):

register checks the token with your GitLab server and writes a [[runners]] entry to C:\GitLab-Runner\config.toml. The running service notices the change and loads it within a few seconds, with no restart. Check it:
gitlab-runner list
gitlab-runner verify
list shows your runner with its executor and URL, and verify confirms GitLab accepts it. In GitLab, the runner appears on the Runners page with a green status once it has contacted the server, and its details show this VM's system ID.
Your token is now in config.toml, which only SYSTEM, Administrators and the runner's own account can read. To unregister the runner later, run gitlab-runner unregister --all-runners here and delete it in GitLab.
Step 7: Run a first pipeline
Add a .gitlab-ci.yml file to the root of the project's repository. Jobs run in PowerShell 7 on this VM, in a working copy under C:\GitLab-Runner\builds:
windows-build:
tags:
- windows
script:
- '"Running on $env:COMPUTERNAME as $([Security.Principal.WindowsIdentity]::GetCurrent().Name)"'
- $PSVersionTable.PSVersion
- git --version
- Get-ChildItem
Commit it. The pipeline starts, the runner picks the job up within a few seconds, checks out the repository with Git, and runs the script. Open the job in Build > Jobs to read its log, which shows Running on <your VM> and the job running as NT SERVICE\gitlab-runner.
Install the build tools your projects need, the .NET SDK, Visual Studio Build Tools, Node.js, Python and so on, from their official installers as an administrator, then restart the service so it sees any new PATH entries:
Restart-Service gitlab-runner
The shell executor runs jobs directly on this VM, one at a time by default (concurrent = 1 in config.toml). To run more at once, raise concurrent and the runner's limit, within what the VM's size can take. This image does not include Docker, so the Docker executor is not set up.
Step 8: Keeping Windows and GitLab Runner up to date
Windows: Windows Update is on, as in Microsoft's image. Check for updates in Settings > Windows Update, and plan restarts: the runner service starts again by itself after a restart. A restart while a job is running fails that job.
GitLab Runner: keep the runner within the supported range of your GitLab server's version (see GitLab's compatibility notes). To upgrade, download the new gitlab-runner-windows-amd64.exe from GitLab's binary downloads, check its checksum against the release's release.sha256, then in an elevated PowerShell window:
Stop-Service gitlab-runner
Copy-Item .\gitlab-runner-windows-amd64.exe 'C:\Program Files\GitLab Runner\gitlab-runner.exe' -Force
Start-Service gitlab-runner
gitlab-runner --version
The service, its account and your registration are kept.
Server Components
| Component | Version or setting | Where |
|---|---|---|
| GitLab Runner | 19.6.2 (windows-amd64) | C:\Program Files\GitLab Runner\gitlab-runner.exe, on the machine PATH |
| Runner service | gitlab-runner, Automatic, NT SERVICE\gitlab-runner, restarted on failure |
Services console |
| Runner configuration | concurrent = 1, no runner until you register |
C:\GitLab-Runner\config.toml (CONFIG_FILE) |
| Executor tools | PowerShell 7.6.10 LTS, Git for Windows 2.56.1.2 | C:\Program Files\PowerShell\7\, C:\Program Files\Git\ |
| Windows Server | 2025 Datacenter, Desktop Experience, 24H2, build 26100 |
Filesystem Layout
| Path | What it holds |
|---|---|
C:\Program Files\GitLab Runner\ |
gitlab-runner.exe, LICENSE (GitLab Runner, MIT), config.toml.template, gitlab-runner-selftest.ps1, README.txt |
C:\GitLab-Runner\ |
The runner's own folder: config.toml, .runner_system_id, and builds\ and cache\ once jobs run. SYSTEM and Administrators full control, NT SERVICE\gitlab-runner modify, nobody else |
C:\ProgramData\gitlab-runner-firstboot.log |
What the one-time first-boot task did |
C:\ProgramData\gitlab-runner-firstboot.done |
Written when the first-boot task finished, with this VM's runner system ID |
The runner's folder, checked with icacls C:\GitLab-Runner:
C:\GitLab-Runner NT AUTHORITY\SYSTEM:(OI)(CI)(F)
BUILTIN\Administrators:(OI)(CI)(F)
NT SERVICE\gitlab-runner:(OI)(CI)(M)
Successfully processed 1 files; Failed processing 0 files
The OS disk is Microsoft's 127 GB Windows disk (C:, NTFS). On sizes that have an Azure temporary disk (D:), never keep data there: Azure can wipe it when the VM is stopped or moved. For large builds or caches, add a managed data disk.
Managing the Service
From an elevated PowerShell window:
Get-Service gitlab-runner # status
Stop-Service gitlab-runner # stop taking jobs (a running job fails)
Start-Service gitlab-runner
Restart-Service gitlab-runner
gitlab-runner stop, start and restart do the same. To stop it starting at boot, Set-Service gitlab-runner -StartupType Manual.
Logs
The runner service writes its log to the Windows Application event log, source gitlab-runner. Read the latest entries in an elevated PowerShell window:
Get-WinEvent -ProviderName gitlab-runner -MaxEvents 5 | ForEach-Object { "$($_.TimeCreated.ToString('s')) $($_.LevelDisplayName) $(($_.Message -split "`n")[0])" }
2026-12-03T16:00:22 Information [session_server].listen_address not defined, session endpoints disabled builds=0 max_builds=1
2026-12-03T16:00:22 Information listen_address not defined, metrics & debug endpoints disabled builds=0 max_builds=1
2026-12-03T16:00:22 Information Initializing executor providers builds=0 max_builds=1
2026-12-03T16:00:22 Information Configuration loaded builds=0 max_builds=1
2026-12-03T16:00:22 Information Usage logger disabled builds=0 max_builds=1
The two listen_address not defined lines are expected: the runner opens no session or metrics port.
Or open Event Viewer (eventvwr.msc), Windows Logs > Application, and filter by the source gitlab-runner. Each job's own log is in GitLab, on the job's page.
On Startup
At the first start of your VM, the scheduled task \cloudimg\GitLab Runner first boot (SYSTEM) runs once:
- It waits until Azure has finished setting up the VM
- It checks that
C:\GitLab-Runnerstill has its permissions (SYSTEM, Administrators and the runner's account only), and refuses to go on if not - It writes
config.tomlfresh from the template, with no runner registered - It sets the
gitlab-runnerservice to start automatically, starts it (trying again if Windows reports a slow first start, which is normal while a new VM is busy), and waits until the service has made this VM's runner system ID - It writes
C:\ProgramData\gitlab-runner-firstboot.done, then deletes the task and its script
It runs only once, so there is nothing to turn off. Every start after that, Windows starts the gitlab-runner service.
Troubleshooting
gitlab-runner-firstboot.done is missing
The first-boot task may still be running: give it a minute or two and check again. Its log shows how far it got:
Get-Content C:\ProgramData\gitlab-runner-firstboot.log
The runner does not show as online in GitLab
- Check the service is running (Step 3) and read its log (Logs, above)
- Run
gitlab-runner verifyin an elevated PowerShell window: it says whether GitLab accepts the runner's token - The VM must reach your GitLab server over HTTPS (port 443) outbound. Azure allows outbound traffic by default; check any firewall or network rule you added
- For your own GitLab instance with a certificate from a private authority, add that authority's certificate to the Local Computer > Trusted Root Certification Authorities store, or set
tls-ca-filefor the runner inconfig.toml(see GitLab's self-signed certificates documentation)
Jobs stay pending
The job's tags must match the runner's tags, or the runner must be set to Run untagged jobs. Check both on the runner's page in GitLab.
A job cannot find a tool you installed
The service reads PATH when it starts. After installing a tool, run Restart-Service gitlab-runner. Jobs run as NT SERVICE\gitlab-runner, not as your administrator: a tool installed only for your own user is not on its PATH.
"Access denied" in a job
Jobs run as NT SERVICE\gitlab-runner, which can write only to C:\GitLab-Runner and its own profile. Give it rights on the folder a job must write to (here F:\Artifacts on a data disk you added):
icacls 'F:\Artifacts' /grant 'NT SERVICE\gitlab-runner:(OI)(CI)M'
gitlab-runner commands show another configuration
CONFIG_FILE points every gitlab-runner command at C:\GitLab-Runner\config.toml. In a PowerShell window opened before a change to the machine's environment, or with CONFIG_FILE changed, pass --config C:\GitLab-Runner\config.toml explicitly.
Forgot the Windows password
Use Reset password on the VM's page in the Azure portal.
Security Recommendations
- Keep Remote Desktop restricted to your own address (Step 1), or use Azure Bastion
- Anyone who can run a pipeline on this runner can run code on this VM as
NT SERVICE\gitlab-runner. Register it only for projects you trust, prefer a project or group runner over an instance runner, and consider GitLab's Protected option so it takes only jobs from protected branches and tags - Keep jobs off administrator rights. The service runs as its own virtual account by design; do not change it to LocalSystem or an administrator
- Protect
config.toml. After registering, it holds your runner's token. It is readable only by SYSTEM, Administrators and the runner's account; do not copy it to shared places - Keep secrets in GitLab's CI/CD variables (masked and protected), not in your repository
- Keep Windows and GitLab Runner updated (Step 8)
Support
cloudimg's support team is on hand 24 hours a day by email (support@cloudimg.co.uk), with a guaranteed response within 24 hours, covering deployment, Remote Desktop access, the runner service, registration and upgrades.
- Email: support@cloudimg.co.uk
- Website: www.cloudimg.co.uk
- Product Catalogue: www.cloudimg.co.uk/products
- User Guides: www.cloudimg.co.uk/guides
GitLab Runner is open source software published by GitLab Inc. under the MIT licence. GitLab is a trademark of GitLab Inc.; cloudimg is not affiliated with or endorsed by GitLab Inc. Microsoft and Windows Server are trademarks of the Microsoft group of companies. All product and company names are trademarks or registered trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them.