100% off usage fees for 3 months with code “BLACKFRIDAY100”

Guide

How to sell Composer packages

What you need to sell a PHP or Laravel package through Composer: a private registry, license keys, payments, update policies and a customer portal.

Last updated

Plenty of PHP developers make a living from paid packages: Laravel and Filament plugins, admin panels, starter kits, integrations and SDKs. The code is the hard part, but selling it through Composer takes more than a Stripe payment link. This guide covers what you need and how to set it up.

What you need to sell a Composer package

  1. A private Composer repository. Packages on Packagist.org are public, so paid packages need a repository that checks credentials before serving anything. See how to host private Composer packages for the options.
  2. A license key per customer. Each customer authenticates with their own key, so you can see who installs what and revoke one customer without affecting the rest. Read Composer license keys explained.
  3. Payments that create licenses. A purchase should create a license and email the key straight away, and a failed renewal or refund should change access without you doing anything.
  4. Rules about updates. Decide which versions a license can install and what happens when it expires.
  5. A place for customers to help themselves. Customers lose keys, change jobs and need invoices. A customer portal saves you a lot of support email.

Choose a pricing model

Most paid Composer packages use one of these models:

  • One-off price with a year of updates. Customers pay once and receive updates for a set period. When it ends they keep the versions they already had access to and can renew for more.
  • Yearly subscription. Access continues while the subscription is active, which suits packages that need regular updates to keep working, such as API integrations.
  • Lifetime access. One payment for every future version. Simple to sell, but it gives you no recurring revenue.
  • Team or tiered pricing. Price by the number of developers or projects, with a discount for larger teams.

In Privato each of these is a release channel: you set a one-off or yearly price, tiers for bulk purchases, how many days of updates a purchase includes, a version constraint such as ^2.0, and whether an expired license loses access completely or keeps the releases published before it expired.

Selling a Composer package with Privato

  1. Create an account and connect GitHub and Stripe. Payments go straight to your own Stripe account.
  2. Create a package from your GitHub repository. Privato syncs existing tags and adds a webhook, so every new GitHub release appears in your registry automatically. See Packages.
  3. Add release channels for the plans you sell, such as "Single project" and "Unlimited projects".
  4. Share your checkout page. Each package gets a public page with pricing and a Stripe checkout. When someone buys, Privato creates their license and emails them their key.
  5. Let customers install. They add your repository and their license key to Composer and run composer require. The customer portal shows them the exact commands.

The quick start covers each step in more detail. You can also offer bundles and coupons, host your documentation for licensed customers, invite buyers to your GitHub repository, and let other developers promote your package through the affiliate network.

Fees: flat per license, not a percentage

Some platforms take a percentage of every sale. On a $199 package, a 10% fee is $19.90 per sale. Privato charges a flat fee for each new license instead: $1.50 on the free Launch plan, $0.75 on Growth and $0.50 on Scale, plus Stripe's processing fees. The more your package costs, the more you keep. See pricing, or compare Privato with Anystack and Private Packagist.

Already selling somewhere else?

If you already have customers and licenses on another platform, Privato can migrate your customer and license data for you.

Frequently asked questions

Can I sell a package that is on Packagist.org?

Not the same version. Anything on Packagist.org is public, so a paid package has to be served from a private Composer repository that checks credentials before every install.

Should I sell one-off licenses or subscriptions?

Both work. A common model for PHP and Laravel packages is a one-off price that includes a year of updates, after which the customer keeps the versions released during that year. Privato supports one-off and yearly subscription pricing, and tiered pricing for team licenses.

How much does Privato charge?

Privato has a free Launch plan and paid Growth ($12/month) and Scale ($30/month) plans. Each new license costs $1.50, $0.75 or $0.50 depending on the plan. Privato never takes a percentage of the sale. Stripe charges its usual processing fees.

Can I sell npm packages too?

Yes. Privato also hosts private npm packages, with the same licenses, release channels, coupons and bundles as Composer packages.

Ready to start shipping your private packages?

Sign up and give it a try.

Sign up for free