Notes · Oleksandr Osadchyi · Updated · 8 min read

Magento 2 extension license server: how vendors do it, your options, and a setup to copy

If you sell Magento 2 extensions, you need licensing: a way to issue keys, deliver code only to people who paid, and stop serving updates when the paid period ends. Below is how the known vendors do it, the options you can pick from for each part, and a universal setup that avoids their mistakes.

I am Oleksandr Osadchyi, an ex-Magento 2 core engineer and Adobe Certified Master, Adobe Commerce Architect, with 13 years on Magento stores. My commits are in the public magento/magento2 repository.

How vendors do it today

Findings from my research for a licensing specification: vendor code, documentation and EULAs.

VendorHow it worksWhat to learn from it
AmastyA base module, amasty/base, ships inside every extension and talks to the license server. Composer-only delivery since January 2025.The license call runs synchronously when the admin saves config, with a 60-second timeout. The license channel sets verifypeer => false. Only the default store hostname is sent. The result is cached unsigned, so one SQL UPDATE forges active. A long time without a check counts as an error, so a broken merchant cron produces a license error.
MirasvitLicense result cached in the store database. The key is part of the Composer repository URL.The cache is unsigned, same forgery. The URL with the key ends up in the merchant's committed composer.json and is shared with every contractor.
AheadworksSubscriptions. Composer repository at dist.aheadworks.com, authenticated with account keys. Most modules have no license keys. The EULA allows automated callbacks that collect the store URL and the active module name.Delivery by account, without a key per store, works. Its Advanced Subscription Products is a SaaS at $50/mo: run your renewals on it and the vendor holds a kill switch on your dependency.
Hyvä, SyliusPrivate Packagist for Vendors delivers the code per customer, per version, with an expiry date.Enforcement sits in code delivery, and nothing has to be checked inside the store.
KeygenLicensing as a service.Licenses bind to a machine fingerprint, so binding to a domain is a convention you keep yourself.

The warning example: in May 2025 Sansec reported a backdoor in 21 extensions on 500 to 1000 stores, dormant for 6 years. It lived in a file called License.php and used include_once($licenseFile).

The same vendors from the merchant's side are in my notes on Amasty's license registration and Aheadworks' license terms.

Your options

License server

  1. Cloudflare Workers + D1. £0 on the no-cost tier, nothing to operate. About 200 requests a day against a 100,000 limit, and Ed25519 is built in. My recommendation.
  2. Workers paid, $5/mo. Same thing without the daily limit of the no-cost tier.
  3. PHP app on a VPS, about £5/mo. You own kernel updates, backups and uptime. Only if the team insists on PHP.
  4. Keygen. $0 up to 100 licenses, then $99/mo, nothing to operate. Viable if you prefer to buy; domain binding stays a convention.
  5. Inside your own Magento shop. Do not: one setup:upgrade takes licensing down for every customer at once.

Code delivery

  1. Private Packagist for Vendors. Lowest setup, nothing to operate, and the data model is exactly customer, package, version, expiry. My recommendation. The price I have is €59/mo with the first 59 customers included, then €1 each; check with them whether that plan is standalone or needs an organization plan under it.
  2. Own Cloudflare Worker + R2. £0, low setup, low ops, and R2 does not charge for egress. The fallback.
  3. Packeton, self-hosted, MIT. Costs a VPS, medium setup, and you own the uptime of every customer's deploy path. Only if SaaS is refused.
  4. Satis. £0, highest setup and ops. It has no access control at all, so you build the auth layer.
  5. Gitea or GitLab package registry. £0, low setup. Permissions are per user and there is no concept of expiry.

Renewals

Magento has no recurring billing in any edition; I checked the 2.4.8 source and there is no scheduler.

  1. Renewal as another order for a renewal SKU. No extra infrastructure. My recommendation.
  2. Stripe subscriptions through the Stripe connector. Needs Stripe Billing.
  3. A SaaS subscription engine such as the Aheadworks one, $50/mo. A third party gets a kill switch on your renewals.

My universal setup

One rule shapes everything: the Composer repository enforces the license, and the base module only records and displays. PHP ships as source, so a check inside the module can be deleted in five minutes, and encoding does not help because Magento's DI lets anyone override the class.

License server

On its own domain, license.example.com, with a webhook from the payment provider: paid issues a key, refunded revokes it.

TableColumns
licensesid, key, customer_id, product_sku, state, use_rights, updates_until, created_at, revoked_at
installationsid, license_id, install_date, primary_host, all_hosts, magento_version, php_version, is_production, first_seen, last_seen
eventsid, license_id, type, payload, created_at
EndpointCalled byWhat it does
POST /activateCLI or one admin button, onceReceives the key, install date, all store hostnames, Magento and PHP versions, mode and your installed modules. Returns an instance id and a signed assertion.
POST /checkCron, once a dayReceives instance id, key and a hash of that state. Under 300 bytes when nothing changed. Returns a fresh assertion.
POST /deactivateCLIReleases the installation slot. Returns 204.
GET /keysNobody at runtimeLists public keys so a later module version can pin a new one.

Key and signed assertion

Key format: ACME-K7QW-2H8T-M4KD-A93F-X. A prefix so support can grep it, 16 characters of Crockford base32 (80 bits, no I, L, O, U, case-insensitive) and 1 check character, so the admin form rejects a typo before any network call. One key per customer; the same string is the Composer password in auth.json, never in the repository URL.

The server signs every answer with Ed25519. The private key stays on the server, the public key is a PHP constant in the base module, and the module caches the assertion in its own table in the store database:

{
  "lic": "ACME-K7QW-2H8T-M4KD-A93F-X",
  "inst": "ins_01J9Q4V7WZ8M3KDA",
  "primary": "example.com",
  "env": "production",
  "iat": 1756039327,
  "exp": 1758631327,
  "refresh_after": 86400,
  "state": "active",
  "checks_enabled": true,
  "ent": [
    { "sku": "Acme_OrderNotes", "use": true, "updates_until": 1787536000 }
  ],
  "messages": []
}

With a signature, forging active means editing vendor PHP, which composer update overwrites. ext-sodium is already required by magento/framework, and verification measured 0.023 ms.

Base module: hard rules

Composer expiry

Versions released after the expiry date are not served. Everything released before it stays installable, and the token keeps working: a dead token fails composer install in a clean CI container and breaks the customer's deploy. Renewal is one API call that moves the date forward.

Two things break if you skip them:

Order of work

  1. License server: database, /activate, /check, signing.
  2. Entitlement record: who bought what, which version, until when. The only thing that is painful to backfill after 100 sales.
  3. Authenticated download and the key in the order email. The first sale is possible here.
  4. Private Composer repository with credentials per customer.
  5. Base module: registration, status, CLI.
  6. Renewals, dunning and refunds, once there is a renewal base.

Do not build

If you want this built for your extensions, I can help

I build this setup for vendors and agencies with Claude Code: the license server, the base module, the Composer repository and the release pipeline around them. Claude Code writes, I review every line, so the whole setup takes days. I am an ex-Magento 2 core engineer, the scope is fixed before work starts, and I bill by the hour for the hours worked. Contact me with how many extensions you have and where you sell them; my rate is on the pricing page.

FAQ

Can a license check inside a Magento 2 module be bypassed?

Yes. PHP ships as source and DI lets anyone override a class, so the check can be removed in minutes. Enforce the license in the Composer repository and use the module to record and display.

Should an extension stop working when the license expires?

No. expired keeps the right to run the code and blocks only new versions.

Do I need ionCube or obfuscation?

No. Adobe rejects encrypted extensions from the Marketplace, Commerce Cloud needs a support ticket with 48 hours' notice per environment, and DI overrides defeat the encoding anyway.