Creating a new Windows Server with the API
Prerequisites:
Section titled “Prerequisites:”- You are familiar with the STACKIT IAAS API & CLI: How to create a VM via IaaS-API
Find the correct Windows Server image
Section titled “Find the correct Windows Server image”The first important step to create a server with the STACKIT IAAS API or CLI is to find the proper STACKIT image for your operating system version. STACKIT currently provides images for the following Windows Server versions:
- Windows Server 2016
- Windows Server 2019
- Windows Server 2022
- Windows Server 2025
You can generate a list of all generally available or all currently released Windows Server images by using one of the STACKIT IAAS CLI commands below.
List all generally available images
Section titled “List all generally available images”stackit curl https://iaas.api.eu01.stackit.cloud/v1/projects/{projectID}/images | jq '.items[] | select(.name == "^Windows Server (2016|2019|2022|2025) Standard") | {id, name, status, scope}'List all currently released images
Section titled “List all currently released images”stackit curl https://iaas.api.eu01.stackit.cloud/v1/projects/{projectID}/images | jq '.items[] | select(.name == "^Windows Server (2016|2019|2022|2025) Standard$") | {id, name, status, scope}'Example output
Section titled “Example output”{ "id": "0a179f46-16ef-4862-b57b-756c15a902a5", "name": "Windows Server 2016 Standard", "status": "AVAILABLE", "scope": "public"},{ "id": "70a1fc51-c43c-4e0e-9d2c-d40433640cad", "name": "Windows Server 2019 Standard", "status": "AVAILABLE", "scope": "public"},{ "id": "e22f8a22-334c-4294-991c-bd5158380155", "name": "Windows Server 2022 Standard", "status": "AVAILABLE", "scope": "public"},{ "id": "03e41242-6d4a-4432-bd56-41f8d00a4202", "name": "Windows Server 2025 Standard", "status": "AVAILABLE", "scope": "public"}Create a STACKIT Windows Server
Section titled “Create a STACKIT Windows Server”We provide an OS image that allows you to deploy STACKIT Windows Server instances.
STACKIT IAAS API
Section titled “STACKIT IAAS API”If you prefer to create your server using the STACKIT IAAS API, please follow the documentation linked here: How to create a VM via IaaS-API
Additionally, ensure that you provide the correct user data to pass your user credentials to the new server. This step is required to log in after the first boot configuration is completed.
The following section explains how to prepare the user data.
Injecting user credentials via custom user data
Section titled “Injecting user credentials via custom user data”If you want to use custom scripts to configure your server individually on the first boot, we currently support cloud-config and x-shellscript (e.g., PowerShell for Windows or Bash for Linux) to inject custom user data into your machine.
Provide plaintext username(s) and password(s)
To create the server with predefined user credentials, provide them in a YAML file as user data like shown in the examples below.
Example 1: Set only the default administrator’s password
| #cloud-configusers: - name: Administrator passwd: ‘Your_at_least_15_characters_password’ groups: Administrators |
|---|
Example 2: Set passwords for additional users
| #cloud-configusers: - name: AdditionalUserName1 passwd: ‘Your_at_least_15_characters_password’ groups: Administrators - name: AdditionalUserName2 passwd: ‘Your_at_least_15_characters_password’ groups: Administrators |
|---|
In the example above, the default Administrator account will receive a randomly generated password, as its username cannot be renamed.
Note: If the provided passwords do not meet the required complexity criteria, you will not be able to use them to log in to the instance.
Password requirements:
- At least 15 characters
- At least 1 special character
- At least 1 number
- At least 1 capital letter
Join Your Server to a Domain
Section titled “Join Your Server to a Domain”You can add your server to a domain and log in with a domain user by providing the following data in the user data configuration in form of a Powershell script.
Example: Domain-join setup
| $host_name = ‘Server-Test’ # Rename the computer during the AD join$dns1 = ‘10.1.0.214’$dns2 = ‘10.1.0.214’ # Optional$DomainName = ‘contoso.local’$DomainUser = ‘contoso.local\stackituser’$DomainPassword = ‘PutYourPasswordHere’ |
|---|
For further details on user data, please refer to the official cloudbase-init documentation: Userdata — cloudbase-init 1.1.7 documentation
Additionally, please review the FAQs & Known Issues Windows Server for more information.