Deploy a Private KMS Server on Your Own VPS

This tutorial explains how the KMS protocol works and how to deploy a private KMS server on a Linux VPS for learning and research purposes only. All steps reference open-source projects hosted on GitHub.

Why Self-Host a KMS Server?

  • Learn how the KMS activation protocol works in practice
  • Study client-server communication on port 1688
  • Experiment with Volume Licensing in a lab environment
  • Avoid relying on third-party public KMS nodes

Prerequisites

  • A Linux VPS (Ubuntu 20.04+ or Debian 11+ recommended)
  • Root or sudo access via SSH
  • Basic familiarity with Linux command line
  • Port 1688 open in firewall

KMS Protocol Architecture

Microsoft KMS (Key Management Service) is a client-server activation model designed for enterprise environments. The client sends an activation request to the KMS server on TCP port 1688, and the server responds with a license token valid for 180 days. The client automatically renews every 7 days.

  1. 1 Client runs slmgr /skms your-server-ip to set KMS host
  2. 2 Client runs slmgr /ato to send activation request
  3. 3 KMS server validates the GVLK and responds with a token
  4. 4 Client is activated for 180 days, auto-renews every 7 days

Setup Steps

Step 1: Get a VPS

Choose a VPS provider and create a Linux instance. Any provider with 1 vCPU + 512MB RAM is sufficient — KMS uses almost no resources.

Step 2: Install vlmcsd

vlmcsd is an open-source KMS emulator. You can find it on GitHub (search for vlmcsd). Below are the general installation steps:

# Download the latest release from GitHub
cd /tmp
# wget https://github.com/.../vlmcsd-...-linux-x64
# chmod +x vlmcsd
# mv vlmcsd /usr/local/bin/

Step 3: Open Firewall Port 1688

KMS uses TCP port 1688. Make sure it is open in your firewall:

# UFW (Ubuntu/Debian)
sudo ufw allow 1688/tcp

# firewalld (CentOS/RHEL)
sudo firewall-cmd --permanent --add-port=1688/tcp
sudo firewall-cmd --reload

Step 4: Start the Service

Run vlmcsd in the background:

# Start vlmcsd (runs as daemon by default)
vlmcsd

# Verify it's running
netstat -tlnp | grep 1688

Step 5: Connect from Client

On your Windows machine, open CMD/PowerShell as admin:

slmgr /skms YOUR_VPS_IP
slmgr /ato

Alternative: Docker Deployment

If you prefer Docker, search for vlmcsd images on Docker Hub:

docker run -d --name vlmcsd -p 1688:1688 --restart=always mikolatero/vlmcsd

Auto-Start on Boot (systemd)

Create a systemd service file to keep vlmcsd running after reboot:

sudo tee /etc/systemd/system/vlmcsd.service << 'EOF'
[Unit]
Description=vlmcsd KMS Emulator
After=network.target

[Service]
Type=forking
ExecStart=/usr/local/bin/vlmcsd
Restart=on-failure

[Install]
WantedBy=multi-user.target
EOF

sudo systemctl daemon-reload
sudo systemctl enable vlmcsd
sudo systemctl start vlmcsd

Verify Your Server

Use our KMS Server Status Check tool to test if your server is reachable on port 1688.

Important Notice

  • • This tutorial is for learning and research only. Do not use it for unauthorized activation.
  • • vlmcsd is a third-party open-source project. We do not host or distribute the software.
  • • For production environments, please use official Microsoft Volume Licensing.
  • • KMS activation is valid for 180 days and requires periodic renewal.