Cloud Native 6 min read

Deploy a Docker‑Based KMS Server and Activate Windows & Office

This guide walks you through installing Docker CE, pulling and running a KMS‑server container, configuring firewall and security‑group rules, then using slmgr commands to activate Windows Server 2012 R2 and Office 2016 via the KMS service, with all required code snippets and screenshots.

Open Source Linux
Open Source Linux
Open Source Linux
Deploy a Docker‑Based KMS Server and Activate Windows & Office

1. Basics

KMS (Key Management Service) provides volume activation for Windows and Office; a self‑hosted KMS server can keep systems activated automatically every 180 days.

2. Deploy KMS Server

Install Docker‑CE

yum install -y yum-utils device-mapper-persistent-data lvm2</code><code>yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo</code><code>yum -y install docker-ce

Start Docker and enable it on boot:

systemctl start docker</code><code>systemctl enable docker

Pull the KMS server image: docker pull qinlulu/kms-server Run the container and expose port 1688:

docker run -itd -p 1688:1688 --name kms qinlulu/kms-server

List running containers to verify: docker ps Set the container to restart automatically: docker update --restart=always kms Disable the host firewall or open port 1688:

# systemctl stop firewalld</code><code>firewall-cmd --permanent --zone=public --add-port=1688/tcp</code><code>firewall-cmd --reload

If using an Alibaba Cloud ECS instance, configure the security group to allow inbound traffic on port 1688.

3. Activate Windows

Check if the OS supports KMS activation: slmgr /dlv Look for "VOLUME" in the description line. Set the KMS server address: slmgr /skms 39.96.81.141 Optionally install a client key (replace XXXX with the key from Microsoft): slmgr /ipk XXXX Activate Windows: slmgr /ato 4. Activate Office

Verify KMS support for Office: cscript ospp.vbs /dstatus Set the KMS host: cscript ospp.vbs /sethst:39.96.81.141 Activate Office: cscript ospp.vbs /act If no key is installed, obtain a KMS client key from Microsoft (e.g., https://docs.microsoft.com/zh-cn/DeployOffice/vlactivation/gvlks) and install it:

cscript ospp.vbs /inpkey:XQNVK-8JYDB-WJ9W3-YJ8YR-WFG99

Then run the activation command again.

5. Fan Benefit

The public KMS server is reachable at 39.96.81.141; you can use it to activate Windows and Office for free.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

KMSContainer Deploymentoffice activationwindows activation
Open Source Linux
Written by

Open Source Linux

Focused on sharing Linux/Unix content, covering fundamentals, system development, network programming, automation/operations, cloud computing, and related professional knowledge.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.