py-kms is pretty cool

This guide explains how to use the py-kms Docker image to activate Windows.

Setup


  1. First you need to have Windows 10 or 11 installed. If you need an ISO, you can download them from Microsofts website. For Windows 11, you will get a link to directly download an ISO. For Windows 10, you can directly download an ISO if you are using a non-Windows http User-Agent, otherwise it forces you to use a software download tool.

  2. Have a key ready for the version of Windows you want to activate. You can find a list of keys on the py-kms documentation.

  3. You will also need another machine running Docker. This machine needs to have a different IP address than the Windows machine. If you don't have a separate physical machine, I recommend installing any Linux distro that you're comfortable with as a virtual machine in VirtulBox. Don't forget to configure the network as bridged so the machine gets a different IP address.

  4. Note the IP address of the Docker machine so that you can point Windows to the server. You might want to make sure both machines can communicate with each other at this point.

Running pyKMS and activation


Start the py-kms Docker image

docker run -p 1688:1688 pykmsorg/py-kms

The KMS server should now be running.

Run the following commands in an admin powershell window on the Windows machine

  1. Uninstall a previously installed key, if needed.

    slmgr /upk

  2. Install the Windows key from step 2 in the above setup.

    slmgr /ipk <Windows Key>

  3. Connect to the KMS server running in the Docker container.

    slmgr /SKMS <IP address of docker server>

  4. Activate.

    slmgr /ato

  5. Show when the activation will expire.

    slmgr /xpr

When the activation expires, you just need to run the kms server docker image and do steps 3 and 4 again.