License key security
How license keys get shared, forged or replayed, and the defenses that work: signed answers, replay protection, hashed keys, device secrets, rate limits.
Run and sell
A self-hosted license server is license key software that you install and run on your own server instead of renting a hosted licensing service. It issues keys, activates devices, answers your application’s license checks and lets you revoke keys, while keys, customer records and signing keys stay in your own database. In exchange, you run it: TLS, backups, updates and monitoring are your job.
Last updated
Whatever it is called, a license key server for installed software has four jobs:
Most sellers also need release downloads for licensed customers, a way for customers to move a license to a new computer, and an audit trail of who changed what.
Search results for “license server” mix two different kinds of software. A floating (concurrent) license manager hands out a limited pool of seats to users on a network, usually inside one company, and takes a seat back when someone closes the program. A license key server, the subject of this guide, issues individual keys to customers, binds each key to a number of devices and checks it over the internet.
Velsigil is a license key server. It does not do floating or concurrent seats, and it does not meter usage. If you need a seat pool shared on a company network, you need a different kind of tool.
There are three ways to get a license server, and none is right for everyone.
You control everything and pay nothing for software. You also own every security decision: key generation, response signing, replay protection, device binding, rate limits, a customer portal and a staff panel with access control. A licensing system is built once and then defended for as long as you sell, which is usually more work than it looks at the start.
Someone else runs the server, so there is little operations work. In exchange, your customer list and license data live on another company’s systems, and you depend on that service for as long as your shipped builds call it.
You get a finished system and keep the data and the address. You take on the operations: a server, TLS certificates, backups, updates and monitoring. This is the model Velsigil follows: commercial, proprietary software where each installation serves one seller, on a Linux or Windows server you control, paid as a subscription whose plan sets how many production installations you may run and which features you get (see pricing).
Whichever you choose, decide on the address first. Every build you ship calls the license server at the address it was compiled with, and a well-designed client never follows redirects. Use a host name on your own domain that you will keep for years, such as licenses.example.com, not one tied to a server or a provider.
Velsigil runs as a set of Docker containers: the application (Node.js and TypeScript) and PostgreSQL 18 on an internal network, plus optional ClamAV to scan uploaded releases. Background jobs handle license expiry, webhook delivery, data retention and security checks. Its documentation sizes it like this:
| Installation | Licenses | CPU | Memory | Disk |
|---|---|---|---|---|
| Small | up to about 10,000 | 2 vCPUs | 4 GB | 40 GB SSD |
| Medium | up to about 100,000 | 4 vCPUs | 8 GB | 80 GB |
ClamAV adds about 1 vCPU, 3 GB of memory and 2 GB of disk. Velsigil runs as a single instance: rate limits and detectors are kept in memory, so you scale it with a bigger server, not behind a load balancer. PostgreSQL can also be an external or managed database.
The Linux setup is designed for a fresh Ubuntu 22.04 or 24.04 LTS or Debian 12 server, on x86_64 or arm64. Caddy sits in front with automatic HTTPS, HSTS and edge rate limits, and it is the only container that publishes ports. Every container drops all Linux capabilities except the few its image needs and runs with no-new-privileges. The application runs as a non-root user, and the application, migration, Caddy and database containers have read-only root file systems. Migrations run in a separate one-shot container, so the long-running application holds only a data role in the database.
bash deploy/install.sh --domain licenses.example.com --email ops@example.com
The installer installs Docker, hardens the host (firewall, fail2ban, unattended upgrades and, optionally, key-only SSH), generates the secrets on the server, starts the stack, schedules backups and prints a one-time setup link. The first account becomes the owner and must enroll an authenticator app. Caddy listens on IPv4 only; to serve IPv6 visitors, put Cloudflare in front.
On a Windows Server that already runs IIS, Velsigil runs in Docker (Linux containers) behind IIS 10 with URL Rewrite and Application Request Routing, with certificates from Let’s Encrypt through win-acme. The application listens only on 127.0.0.1. PowerShell scripts generate the secrets on the server (readable only by Administrators and SYSTEM), set up the IIS site with site-level settings only, and register scheduled tasks for a daily backup and a weekly restore test. On Windows Server 2022 or later, the setup script restricts the site to TLS 1.2 or later; on older versions that takes a netsh binding option, where supported, or a server-wide SCHANNEL change.
The installation package for customers is being finalized during early access; early-access members get help with installation by email.
A license server is an attractive target: whoever controls it can mint valid licenses. Whatever you run, check for at least these properties:
Velsigil’s security requirements are based on OWASP ASVS 4.0.3 Level 2. That is a design target, not a certification, and Velsigil has not had an external penetration test yet. The license key security guide covers the application side.
A self-hosted server will sometimes be unreachable: during an update, a hosting outage or a network problem on the customer’s side. Plan for it:
GET /api/health answers {"status":"ok"} for your uptime checks.POST /api/panel/licenses with the product, plan and quantity; the keys appear only in that response) and reacts to events such as license.created, license.revoked or license.devices_reset through signed webhooks. The outgoing webhooks are a feature of Velsigil’s Studio plan.Each backup holds the database and the release files, encrypted with GnuPG (AES-256); plaintext never touches the disk. Backups are kept for 14 days, and an optional rclone job copies them off the server. Once a week, a restore test decrypts the newest backup into a throwaway PostgreSQL container and checks the tables. The security center warns when the newest backup is older than 26 hours or the last restore test older than 8 days.
On Linux, deploy/update.sh takes an encrypted backup first, keeps the running images as a rollback point, rebuilds, and runs the database migrations before the application starts. If a migration fails, the application is not started, and update.sh --rollback returns to the previous images.
The master secret, APP_SECRET, encrypts stored secrets and keys the license-key HMACs. It is generated on your server. Right after the installation, keep a copy in an offline password manager or vault, together with the backup key: without both, neither a backup nor the encrypted data in a restored database can be recovered. A product’s signing key can be rotated, but rotation invalidates every shipped build that embeds the old public key, so plan it together with a client release.
Keep reading
How license keys get shared, forged or replayed, and the defenses that work: signed answers, replay protection, hashed keys, device secrets, rate limits.
How software checks a license without internet: signed offline leases, signed license files, grace periods, clock tampering and what each one trusts.
Tie license keys to Stripe subscriptions: paid renewals extend the license, cancellations let it lapse, and full refunds or lost disputes revoke it.
How hardware-locked licenses bind a key to a device: machine IDs per OS, why hardware IDs can be spoofed, device secrets, limits and customer resets.
Early access
Early access is free. In exchange, we ask for your feedback while we prepare the paid launch. Spots are limited, and we reply to every request by email.
Early access ends when paid subscriptions launch; we will tell members by email before then. To keep using Velsigil after that, you need a subscription. The 30% discount applies to the first 12 months of either plan, paid monthly or yearly.
Opens your email app with a short template: company, what you sell, your platforms and languages, expected license volume and how you plan to deploy. You can also write to hello@velsigil.com.