Documentation structure for LLMs (llms.txt)

Install machine runner 3 on Windows (unified script)

Cloud Server

This page describes how to install CircleCI’s machine runner 3 on Windows using the unified install script. The script supports:

  • Windows Desktop and Windows Server.

  • AMD64 and ARM64 machines. The script detects the machine’s architecture and downloads the matching runner binary.

  • Two run modes: Windows Service Mode and Autologon Mode.

The legacy Windows Server install script is still available and documented in Legacy Install of Machine Runner 3 on Windows Server. Use this page for new installations.

Supported Windows versions

CircleCI tests machine runner 3 on the Windows versions in the following table.

Windows version Machine runner 3

Windows Server 2025

Compatible

Windows Server 2022

Compatible

Windows Server 2019

Compatible

Windows 11

Compatible

Windows Server 2016 and older

Not compatible

Windows Server 2025 and Windows 11 version 24H2 share the same Windows build.

Prerequisites

  • Administrator access to the Windows machine.

  • A machine that can create local users. The script creates a local administrator user, named circleci by default, that runs CircleCI jobs.

  • The CircleCI CLI if you wish to create the resource class and token from the command line.

  • On a Windows Server in a domain environment, the server must be a domain member. The self-hosted runner cannot run on a Windows Server operating as a domain controller.

The install script also installs Chocolatey, Git, and Gzip.

Self-hosted runner terms agreement

  • Web app installation

  • CLI installation

Before you can install self-hosted runners through the web app, you will need to agree to the CircleCI Runner Terms. To access the Runners section of the CircleCI web app an organization admin must agree to the terms at Org  Runners.

Runner terms and conditions
Figure 1. Runner terms and conditions

Once the terms have been accepted, Runners will appear permanently in the side navigation.

Your role within your org is determined differently depending on how you integrate with your code, as follows:

  • If you have a github or bitbucket type organization, CircleCI mirrors VCS permissions for organizations. If you are an admin on your organization’s VCS, you are an admin on CircleCI. If you are unsure, check the admin permissions on your VCS.

  • If you have a circleci type organization, you can check roles by navigating to Org  People. Full details on roles and permissions are available in the Roles and Permissions Overview.

Find out about organization types in the Users, Organizations and Integrations Guide.

If you are installing and using self-hosted runners through the CLI, you are agreeing to the CircleCI Runner Terms.

1. Create namespace and resource class

  • Web app installation

  • CLI installation

To install self-hosted runners, you need to create a CircleCI namespace and resource class. Once set up you will receive a resource class token. You must be an organization admin to complete this process. View your installed runners on the inventory page in the web app by selecting Runners from the sidebar.

If you already create orb in your organization you will already have a namespace configured. You must use this same namespace for runners. Each organization can only create a single namespace.
  1. On the CircleCI web app, navigate to Runners and select Create Resource Class.

    Runner set up
    Figure 2. Runner set up, step one - Get started
  2. Create a custom Resource Class. You will configure jobs to use this resource class when you want them to run on your self-hosted runner.

    We suggest using a lowercase representation of your CircleCI account name for your namespace. CircleCI will populate your org name as the suggested namespace by default in the UI.

    Namespace and resource classes must follow specific naming conventions:

    • The namespace can contain lowercase letters, numbers, underscores, and dashes.

    • The resource class name can contain uppercase and lowercase letters, numbers, colons, underscores, dashes, and plus signs.

      Runner set up
      Figure 3. Runner set up, step two - Create a namespace and resource class
  3. Enter a description for your resource class. The description is an optional field.

  4. Select Save and continue to save and view your resource class token.

  5. Copy and save the resource class token. Self-hosted runners use this token to claim work for the associated resource class.

    The token is only displayed once, be sure to store it safely.
    Runner set up
    Figure 4. Runner set up, step three - Create a resource class token
  6. Select the Machine tab and progress on to the platform-specific instructions in the next section of this installation guide.

If you are installing self-hosted runners for server, the CircleCI CLI needs to be configured using your server API key. Run circleci setup to configure the CLI and access the option to supply a new API token if required.

To install self-hosted runners, you need to create a CircleCI namespace and resource class. Once set up you will receive a resource class token. You must be an organization admin to complete this process. View your installed runners on the inventory page in the web app by selecting Runners from the sidebar.

If you already create orb in your organization you will already have a namespace configured. You must use this same namespace for runners. Each organization can only create a single namespace.
  1. Create a namespace for your organization’s self-hosted runners if you do not already have one configured. We suggest using a lowercase representation of your CircleCI organization’s account name.

    Use the following command to create your CircleCI organization’s namespace:

    $ circleci namespace create <name> --org-id <your-organization-id>
  2. Create a resource class for your runner using the following command. You will configure jobs to use this resource class when you want them to run on your slef-hosted runner:

    $ circleci runner resource-class create <namespace>/<resource-class> <description> --generate-token

    Make sure to replace <namespace> and <resource-class> with your org namespace and desired resource class name, respectively. You can add a description but this is optional.

    Resource class names must follow specific naming conventions.

    • The namespace can contain lowercase letters, numbers, underscores, and dashes.

    • The resource class name can contain uppercase and lowercase letters, numbers, colons, underscores, dashes, and plus signs.

      The resource class token is returned after the runner resource class is successfully created.

      The token is only displayed once, so be sure to store it safely.

2. Choose an install mode

The install script supports two run modes. Choose the one that matches the jobs you run. You can only use one mode on a machine, and you cannot use -Service and -Autologon together.

Windows service (-Service) Autologon (-Autologon)

Use for

Jobs that do not need a Desktop session, such as builds and unit tests.

Jobs that need a Desktop session or an interactive shell, such as UI testing.

If you are not sure which to use, choose the Windows service. See Windows Service Mode and Autologon Mode for how each works, and Autologon Security Considerations before you choose autologon.

3. Run the install script

  1. Download the Install-CircleCIRunner-Unified.ps1 script from GitHub to an accessible location.

  2. Open PowerShell as an administrator and navigate to the directory where you placed the script file.

  3. Run the script with -ExecutionPolicy Bypass, and the options for your chosen mode. For example, to install as a Windows service:

    powershell.exe -ExecutionPolicy Bypass -File .\Install-CircleCIRunner-Unified.ps1 `
      -RunnerToken "<runner-token>" `
      -RunnerName "<runner-name>" `
      -Service

    Or, to install with autologon:

    powershell.exe -ExecutionPolicy Bypass -File .\Install-CircleCIRunner-Unified.ps1 `
      -RunnerToken "<runner-token>" `
      -RunnerName "<runner-name>" `
      -Autologon
    The script needs to be run with -ExecutionPolicy Bypass. The default execution policy blocks it on Windows Desktop. On Windows Server it is also blocked if you downloaded the script through a browser.
  4. If you installed with -Autologon, restart the machine.

After your setup completes, the runner begins looking for jobs to process.

Machine runner configuration example

Once you have installed the runner, select Continue in the CircleCI web app. You will be presented with an example configuration snippet showing a job configured to use your new self-hosted runner resource class.

Runner set up
Figure 5. Runner set up, copy code to config file

The fields you must set for a specific job to run using your machine runners are:

  • machine: true

  • resource_class: <namespace>/<resource-class>

Simple example of how you could set up a job:

version: 2.1

workflows:
  build-workflow:
    jobs:
      - runner
jobs:
  runner:
    machine: true
    resource_class: <namespace>/<resource-class>
    steps:
      - run: echo "Hi I'm on Runners!"

The job will then execute using your self-hosted runner when you push the .circleci/config.yml to your VCS provider.

Script parameters

Parameter Required Description

-RunnerToken

Yes

The runner authentication token.

-RunnerName

Yes

The name of this runner instance.

-ApiUrl

No

The runner API URL. For a CircleCI Server installation, set this to the hostname of your server installation, for example https://circleci.example.com. Leave it unset to use CircleCI Cloud.

-Username

No

The local user that runs CircleCI jobs. The default is circleci. Pass the same value to the uninstall script.

-Service

No

Run the runner as a Windows service.

-Autologon

No

Sign in as the runner user at startup and run the runner in that session. Autologon is one setting for the whole machine. The install stops if the machine is already set to sign in as another user.

-AgentBinaryPath

No

Install the given circleci-runner.exe for this machine’s architecture, instead of downloading the released version. Nothing checks that the binary is the right one. Git and Gzip are still installed from the internet.

If you do not pass -Service or -Autologon, the script installs the runner but does not start it.

The script installs the runner to C:\Program Files\CircleCI and writes the runner configuration to runner-agent-config.yaml in that directory. Only administrators and the runner user can read the file. See Machine Runner 3 Configuration Reference for the available settings. The runner log is written to circleci-runner.log in the same directory.

Windows service mode

With -Service, the script registers the runner as the CircleCIRunner Windows service, running as the runner user. The service:

  • Starts automatically at boot, after the other services.

  • Restarts after 5 seconds if it fails.

  • Is started by the script when the install completes.

Autologon mode

With -Autologon, the script sets the machine to sign in as the runner user at startup, and registers a scheduled task that starts the runner at that sign-in. This gives the runner a Desktop session, which suits UI testing and jobs that need an interactive shell. To keep that session available, the script also stops the display and machine from turning off or sleeping, and turns off the screensaver and lock screen.

Autologon starts the runner at every restart or reboot, so the runner survives machine recycles without manual intervention. If the runner exits, the scheduled task starts it again within a minute.

Autologon security considerations

Autologon has a security trade-off. Consider it before you use it.

  • The machine boots into a logged-in administrator session.

  • The runner user’s password is stored on the machine so that Windows can sign in at startup. Any local administrator on the machine, including CircleCI jobs, can read the stored password.

  • Anyone with physical access to the machine can reach the logged-in session.

Only use autologon on machines where you accept these risks, for example, on a dedicated machine that does not hold other secrets.

Remote Desktop sessions and UI tests

If you connect to an autologon machine over Remote Desktop (RDP), disconnecting from the RDP session locks the session. A locked session breaks UI tests that are running.

To avoid this, use tscon from an administrator command prompt to hand the session back to the machine’s console before you disconnect:

tscon <session-id> /dest:console

Find the session ID with query user.

How jobs run on Windows

The unified script runs the runner in continuous Mode, rather than single-task mode. The runner claims a task, runs it, and then claims the next one, as on Linux and macOS.

Because the runner does not restart the user session after each job, be aware that:

  • Processes that a job starts outside the job’s process tree carry over between jobs. Examples are COM servers and scheduled tasks.

  • User profile state, such as files in the user’s profile and registry settings, carries over between jobs.

Design your jobs so that they do not depend on a clean user session, and clean up anything they start outside the job’s process tree.

Uninstall

The unified uninstall script removes the runner, whether you installed it as a Windows service or with autologon.

  1. Download the Uninstall-CircleCIRunner-Unified.ps1 script from GitHub to an accessible location.

  2. Open PowerShell as an administrator and navigate to the directory where you placed the script file.

  3. Enter the following in your PowerShell:

    powershell.exe -ExecutionPolicy Bypass -File .\Uninstall-CircleCIRunner-Unified.ps1

    If you used a different -Username or install directory, pass them to the script with -Username and -InstallDir.

The script removes the CircleCIRunner service and the autologon setup, if present. If it removes an autologon setup, it also restores the lock screen, screensaver, and sleep settings. You can run the script again, or after a partial install.

Use the legacy uninstall script, as described in Uninstall / Reinstall Steps, for runners installed with the legacy install script.

Troubleshooting

Refer to the Troubleshoot Machine Runner guide if you encounter issues installing or running machine runner on Windows.