How to Activate Windows Server VPS for Free via KMS (step-by-step)

Learn how to activate Windows Server for free on your VPS using KMS, with full slmgr commands, error troubleshooting, and final verification.

When you provision a Windows Server VPS, the system usually enters a 180-day evaluation mode. As that period nears its end, Windows starts displaying activation warnings and eventually disables features — including Remote Desktop in some scenarios. To avoid this degradation, the license needs to be activated.

This tutorial covers activation via KMS (Key Management Service) — the standard method for Windows Server Standard and Datacenter in environments that use volume licensing. We will walk through the required slmgr commands, configure the KMS server, run the activation, and verify the result. We also cover handling of the most common errors (0xC004F074, 0xC004F069, 0x8007007B).

Estimated time: 10 to 15 minutes, assuming you already have RDP enabled and a stable connection to the VPS.

Prerequisites

Before starting, confirm that you have administrator access to the VPS and outbound network connectivity on port 1688.

Prerequisites

Windows Server 2019, 2022, or 2025 VPS in any edition (Standard, Datacenter, Essentials), RDP access with a local administrator account, outbound TCP/1688 allowed by the firewall, and an elevated PowerShell or CMD session (“Run as administrator”).

KMS port TCP 1688
Activation validity 180 days
Automatic renewal Every 7 days
Required privilege Local administrator
About legitimate licensing

KMS is official Microsoft technology for corporate volume activation. Third-party public KMS servers exist but operate in a legal grey area. For critical production environments, acquire a legitimate volume key or use Retail/MAK licenses. This guide is educational — the responsibility for usage is yours.

Identify your Windows Server edition

Before applying any key, you need to know exactly which edition is running. The GVLK (Generic Volume License Key) varies by edition, and using the wrong one silently produces a compatibility error.

01

Open PowerShell as administrator (right-click the Start menu → “Windows PowerShell (Admin)”) and run:

slmgr /dlv

This command opens a window with detailed information about the current license. Note the “Description” field — something like “Windows(R) Operating System, VOLUME_KMSCLIENT channel” — and the edition (Standard, Datacenter, or Essentials).

02

To confirm the edition via command line without a popup window, use:

Get-ComputerInfo | Select-Object WindowsProductName, OsName, OsArchitecture

The output will show something like “Windows Server 2022 Standard” or “Windows Server 2022 Datacenter”. Keep this information handy — we will use it to pick the correct key in the next step.

Apply the correct GVLK

Microsoft publishes free GVLK keys on its official documentation site — they only work when paired with a real KMS server, but they are public and can be used freely as an intermediate step of the process.

Table of the most common keys:

EditionGVLK
Windows Server 2022 StandardVDYBN-27WPP-V4HQT-9VMD4-VMK7H
Windows Server 2022 DatacenterWX4NM-KYWYW-QJJR4-XV3QB-6VM33
Windows Server 2019 StandardN69G4-B89J2-4G8F4-WWYCC-J464C
Windows Server 2019 DatacenterWMDGN-G9PQG-XVVXX-R3X87-T3W4W
Windows Server 2025 StandardTVRH6-WHNXV-R9WG3-9D3RV-MY27H
Windows Server 2025 DatacenterD764K-2NDRG-47T6Q-P8T8W-YP6DF
03

Apply the key matching your edition. For Windows Server 2022 Standard, for example:

slmgr /ipk VDYBN-27WPP-V4HQT-9VMD4-VMK7H

Wait for the confirmation. A window will appear saying “Installed product key VDYBN… successfully.” If you get error 0xC004F069, the key does not match the installed edition — review the table.

Do not use OEM or Retail keys here

OEM keys (the ones printed on physical servers) and Retail keys (boxed copies) do NOT work with KMS. Installing a Retail key and then running slmgr /ato against KMS results in error 0xC004F015. Use only the GVLKs from the official table.

Configure the target KMS server

By default, the KMS client looks for the server via DNS (SRV records _vlmcs._tcp). If your VPS is not on a corporate network with an internal KMS, you need to point it manually to a server.

04

Configure the KMS endpoint. Replace kms.example.com with the server you intend to use (your company’s internal KMS, a licensed corporate service, etc.):

slmgr /skms kms.example.com:1688

The :1688 port is the default — you can omit it if you are using that value. The confirmation will be “Machine name set successfully.”

05

Verify that the configuration was saved:

slmgr /dlv | Select-String "KMS"

Look for the line “Registered KMS machine name: kms.example.com:1688”. If it shows “KMS machine name from DNS: not available”, the configuration was not applied — repeat step 04 with proper elevation.

Test connectivity before activating

Run Test-NetConnection kms.example.com -Port 1688 before slmgr /ato. If TcpTestSucceeded returns False, the problem is firewall or DNS — fix it before proceeding, otherwise you will only collect 0xC004F074 errors.

Run the activation

With the key installed and the server configured, trigger the activation itself. The process is synchronous and takes between 5 and 30 seconds.

06

Start the online activation:

slmgr /ato

If everything is correct, you will see “Product activated successfully” and the error code 0x0. That is the success outcome.

07

Confirm the activation expiration date:

slmgr /xpr

The output should show either “The machine is permanently activated” (Retail/MAK key) or “Volume activation expires on MM/DD/YYYY HH:MM:SS” — the latter is the KMS case. The date sits roughly 180 days in the future.

Full state verification

Before considering the task complete, it is worth reviewing the full license state to catch silent inconsistencies.

08

Run the detailed report:

slmgr /dlv

Check these fields in the window that opens:

  • License status: should read “Licensed”
  • Remaining notification period: 0 minutes (if it shows a positive value, activation did not settle)
  • KMS machine hash: must be populated
  • KMS activation count: number of machines registered with the server
09

Also verify via WMI for cross-confirmation:

Get-CimInstance SoftwareLicensingProduct -Filter "ApplicationID='55c92734-d682-4d71-983e-d6ec3f16059f' AND PartialProductKey IS NOT NULL" | Select-Object Name, LicenseStatus

LicenseStatus = 1 means “Licensed” (properly activated). Any other value indicates a problem:

  • 0: Unlicensed
  • 2: OOBGrace (initial grace period)
  • 3: OOTGrace (out-of-tolerance grace)
  • 4: NonGenuineGrace
  • 5: Notification (warning mode — the state we want to avoid)
  • 6: ExtendedGrace

Troubleshooting

Three errors come up frequently. Here are the practical diagnostics.

Error 0xC004F074 — KMS unreachable

This means the client tried to contact the KMS server and failed. Common causes:

# 1. Test connectivity
Test-NetConnection kms.example.com -Port 1688

# 2. Check the sppsvc service
Get-Service sppsvc

# 3. Restart the Software Protection service
Restart-Service sppsvc -Force

# 4. Try activation again
slmgr /ato

If Test-NetConnection returns False, the problem is network. Allow outbound TCP/1688 on the VPS firewall and on any provider security group.

Error 0xC004F069 — incompatible key

The GVLK does not match the Windows edition. Fix: confirm the edition with Get-ComputerInfo and review the table in step 03.

Error 0x8007007B — DNS does not resolve

The configured KMS server name is not being resolved by the local DNS. Diagnostics:

# Check resolution
Resolve-DnsName kms.example.com

# If it fails, configure public DNS temporarily
Set-DnsClientServerAddress -InterfaceAlias "Ethernet" -ServerAddresses 1.1.1.1, 8.8.8.8

After fixing DNS, run slmgr /ato again.

Next steps

With the license activated, the server stays stable for the next 180 days and will renew automatically. From here, you can move on to:

  • Harden RDP: change the default 3389 port, configure Network Level Authentication, and limit source IPs via Windows Defender Firewall.
  • Configure controlled Windows Update: enable automatic security updates but defer feature updates, avoiding unplanned reboots.
  • Monitor expiration: create a scheduled task that runs slmgr /xpr weekly and triggers an alert when fewer than 30 days remain.
  • Back up the activation state: document the GVLK and the KMS endpoint in a vault for quick recovery in case of reinstallation.

If you are putting this VPS into production and need honest infrastructure with a real SLA, KVM virtualization, and built-in DDoS protection, Hostini VPS delivers all of that across Brazilian datacenters — with no fine print on Windows licensing.

Frequently asked questions

Is KMS activation legal?

KMS (Key Management Service) is an official Microsoft mechanism for volume activation in corporate environments. It is legal when you own a valid license or are within a technical evaluation period. Third-party public KMS servers exist in a legal grey area — for production, acquire a legitimate volume key or use an OEM/Retail license.

How long does KMS activation last?

KMS activation is valid for 180 days and renews automatically every 7 days as long as the machine can reach the KMS server. If the server becomes unreachable for more than 180 days, Windows reverts to the notification state until it reconnects.

Can I activate Windows Server Datacenter with a Standard key?

No. Each edition (Standard, Datacenter, Essentials) has its own specific GVLK (Generic Volume License Key). Using the wrong key triggers error 0xC004F069. Confirm the edition with `slmgr /dlv` before applying any key.

Do I need to open any firewall port to activate?

Yes. Communication with the KMS server uses TCP 1688 by default. If your VPS has a restrictive firewall (Windows Defender Firewall or a cloud security group), allow outbound traffic on that port before running `slmgr /ato`.

What should I do when error 0xC004F074 appears?

This error means the client could not contact any KMS server. Check connectivity (`Test-NetConnection server -Port 1688`), DNS resolution, and whether the Software Protection service (`sppsvc`) is running. Restart the service with `net stop sppsvc && net start sppsvc` and try again.

Will activation show as permanent afterwards?

No. KMS is always a renewable temporary activation. To see the real status, run `slmgr /xpr` — it will display the current expiration date. For permanent activation, you need a Retail or MAK (Multiple Activation Key).

Topics:
Next steps Ryzen cloud with NVMe storage and always-on DDoS protection.Go live on a Hostini VPS →
Was this tutorial helpful?
Chat on WhatsApp