Install Windows Server and activate it with a product key

Updated · About 30–60 min

Microsoft’s free download installs an evaluation edition. To use your Standard or Datacenter key, you convert the evaluation to the full edition with one DISM command. No reinstall is needed.

Download the ISO

Pick the version your key is for. Keys are not interchangeable between versions.

Windows Server 2025Microsoft Evaluation Centermicrosoft.com ↗ Windows Server 2022Microsoft Evaluation Centermicrosoft.com ↗ Windows Server 2019Microsoft Evaluation Centermicrosoft.com ↗ Windows Server 2016Microsoft Evaluation Centermicrosoft.com ↗

Install

  1. Write the ISO to a USB drive or mount it in your virtual machine, then boot from it.
  2. When asked for the edition, choose Standard (Desktop Experience) or Datacenter (Desktop Experience) to match your key. Without “Desktop Experience” you get Server Core, which has no desktop.
  3. Choose Custom, pick the disk and finish setup. Set the Administrator password when asked.

Convert the evaluation and activate

  1. Open Command Prompt or PowerShell as administrator and check the current edition:
    Command
    DISM /online /Get-CurrentEdition
    If it ends in Eval (for example ServerStandardEval), continue. If not, skip to the next section.
  2. List the editions you can convert to:
    Command
    DISM /online /Get-TargetEditions
  3. Convert and enter your key in one step. Use ServerStandard or ServerDatacenter to match your key:
    Standard
    DISM /online /Set-Edition:ServerStandard /ProductKey:XXXXX-XXXXX-XXXXX-XXXXX-XXXXX /AcceptEula
    Datacenter
    DISM /online /Set-Edition:ServerDatacenter /ProductKey:XXXXX-XXXXX-XXXXX-XXXXX-XXXXX /AcceptEula
  4. Type Y when asked to restart. The server may restart twice.
  5. After the restart, activate online and check the result:
    Command
    slmgr /ato
    Check activation
    slmgr /xpr
Upgrade and conversion optionsMicrosoft Learnlearn.microsoft.com ↗

Already on a full (non-evaluation) edition

Install your key
slmgr /ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
Activate online
slmgr /ato

If it fails

MessageWhat to do
0xC004F050 or “key not valid” on Set-EditionThe key is for another version or edition. A 2022 key does not work on 2025, and a Datacenter key does not work with ServerStandard.
0xC004F074 after convertingThe server still has a KMS setup key. Run slmgr /ipk with your key, then slmgr /ato.
0xC004C008The key has been used too many times. Ask your seller for a replacement.
Set-Edition seems stuckWait. The progress bar can pause for several minutes. Do not restart until DISM asks you to.

See also all activation error codes.

Key still not working?

Contact the seller you bought the key from. Reply to your order message with the error code or a screenshot: they can check the key and replace it if needed. We don’t sell keys and can’t check or replace them.