> For the complete documentation index, see [llms.txt](https://circleci.com/docs/llms.txt)

# Machine runner 3 manual installation for Windows

This page describes how to manually install CircleCI’s machine runner 3 on Windows Server.

## Prerequisites

*   [tar](https://www.gnu.org/software/tar/)
    
*   [Gzip](https://www.gnu.org/software/gzip/)
    
*   The [CircleCI CLI](https://circleci.com/docs/guides/toolkit/local-cli/) if you wish to install runners from the command line
    

## Self-hosted runner terms agreement

**Web app installation:**

Before you can install self-hosted runners through the web app, you will need to agree to the [CircleCI Runner Terms](https://circleci.com/legal/runner-terms/). To access the **Runners** section of the [CircleCI web app](https://app.circleci.com/) an organization admin must agree to the terms at menu:Org\[Runners\].

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](https://support.circleci.com/hc/en-us/articles/360034990033-Am-I-an-Org-Admin) on your VCS.
    
*   If you have a `circleci` type organization, you can check roles by navigating to menu:Org\[People\]. Full details on roles and permissions are available in the [Roles and Permissions Overview](https://circleci.com/docs/guides/permissions-authentication/roles-and-permissions-overview/).
    

Find out about organization types in the [Users, Organizations and Integrations Guide](https://circleci.com/docs/guides/permissions-authentication/users-organizations-and-integrations-guide/).

**CLI installation:**

If you are installing and using self-hosted runners through the CLI, you are agreeing to the [CircleCI Runner Terms](https://circleci.com/legal/runner-terms/).

## 1\. Create namespace and resource class

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.

In order to install self-hosted runners, you will need to create a namespace and authentication token by performing the steps listed below.

To create resource classes and tokens you need to be an organization administrator in the VCS provider.

You can view your installed runners on the inventory page in the [web app](https://app.circleci.com/) or your CircleCI server app, by selecting **Runners** from the sidebar.

1.  Create a namespace for your organization’s self-hosted runners. **Each organization can only create a single namespace**. We suggest using a lowercase representation of your CircleCI organization’s account name. If you already use orbs, this namespace should be the same namespace orbs use.
    
    Use the following command to create a namespace:
    
    `````````
    circleci namespace create <name> --org-id <your-organization-id>
    `````````
    
    If your organization already has a namespace, you will receive an error if you run the above command to create a _different_ namespace. The error message returns the name of the existing namespace. In this case, move on to step 2 below, using your existing namespace.
    
2.  Create a resource class for your self-hosted runner’s namespace using the following command:
    
    `````````
    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 may optionally add a description.
    
    Example: `circleci runner resource-class create my-namespace/my-resource-class my-description --generate-token`.
    
    The resource class token is returned after the runner resource class is successfully created.
    
    The token cannot be retrieved again, so be sure to store it safely.
    

## 2\. Download the CircleCI machine runner

Using PowerShell, download the current version of CircleCI machine runner and verify the download.

The current CircleCI machine runner binary can always be found by using `current` as the version. To install a specific previous version of the CircleCI runner, the `$runnerVersion` variable can be changed from the value of `current` to the specific preferred version.

`````````
$runnerVersion = "current"
$availableAgents = (Invoke-WebRequest "https://circleci-binary-releases.s3.amazonaws.com/circleci-runner/manifest.json" -UseBasicParsing).Content.Trim() | ConvertFrom-Json
$agentURL = $availableAgents.releases.$runnerVersion.windows.amd64.url
$agentHash = $availableAgents.releases.$runnerVersion.windows.amd64.sha256
$agentFile = $agentURL.Split("/")[-1]

Invoke-WebRequest $agentURL -OutFile $agentFile -UseBasicParsing
if ((Get-FileHash "$agentFile" -Algorithm SHA256).Hash.ToLower() -ne $agentHash.ToLower()) {
    throw "Invalid checksum for CircleCI Machine Runner, please try download again"
}

tar -zxvf $agentFile
del $agentFile
`````````

## 3\. Create the CircleCI machine runner configuration and working directory

Using PowerShell, create the CircleCI machine runner configuration file and working directory.

The runner token created in [Step 1](#create-namespace-and-resource-class) will need to be substituted in for the `auth_token`

`````````
New-Item -Name Workdir -ItemType Directory
@"
api:
  auth_token: "<< YOUR RUNNER TOKEN >>"
  url: https://runner.circleci.com
runner:
  name: "$env:COMPUTERNAME"
  mode: single-task
  working_directory: "./Workdir"
  cleanup_working_directory: true
logging:
  file: circleci-runner.log
"@ -replace "([^`r])`n", "`$1`r`n" | Out-File machine-runner-config.yaml -Encoding ascii
`````````

## 4\. Start the CircleCI machine runner

`````````
./circleci-runner.exe machine --config machine-runner-config.yaml
`````````

## Additional resources

*   [Machine runner 3 Windows installation](https://circleci.com/docs/guides/execution-runner/install-machine-runner-3-on-windows/)
    
*   [Machine runner 3 Linux package installation](https://circleci.com/docs/guides/execution-runner/install-machine-runner-3-on-linux/)
    
*   [Machine runner 3 macOS Homebrew installation](https://circleci.com/docs/guides/execution-runner/install-machine-runner-3-on-macos/)
    
*   [Machine runner 3 Docker installation](https://circleci.com/docs/guides/execution-runner/install-machine-runner-3-on-docker/)
    
*   [Machine runner 3 configuration reference](https://circleci.com/docs/guides/execution-runner/machine-runner-3-configuration-reference/)