Open Source & Self-Hosting

Open-Source Licences Explained for Builders: MIT, Apache, GPL, AGPL and the Ones That Aren't Open

3 October 2026 · Updated 28 November 2026 · 14 min read · by Yang Kai

What the common licences actually permit and require — MIT and Apache-2.0 for permissive use, GPL and AGPL copyleft and what triggers them, and the source-available licences (BSL, SSPL, Elastic) that are not open source despite the marketing. A practical guide, not legal advice.

Table inside: Licence comparison table: what each licence permits, requires and forbids for a builder shipping products

Contents
  1. The comparison
  2. How we researched this
  3. Permissive: MIT, Apache-2.0 and BSD
  4. Weak copyleft: LGPL and MPL-2.0
  5. Strong copyleft: GPL and the distribution trigger
  6. Network copyleft: AGPL and the SaaS trigger
  7. Source-available: BSL, SSPL, Elastic and the Sustainable Use License
  8. When a project changes its licence
  9. Checking a licence in practice
  10. Choosing a licence for your own project
  11. Conclusion

A licence is the contract that decides what you may do with code you did not write: ship it inside a paid product, modify it and keep the changes private, or offer it to customers as a hosted service. Get it wrong and the cost is not a fine print embarrassment — it can be an obligation to publish your own source code, or a product built on a tool you were never allowed to sell.

The good news: the differences that matter to a builder fit on one page. MIT and Apache-2.0 are permissive. LGPL and MPL-2.0 ask for your changes to specific parts back. GPL and AGPL are copyleft with different triggers. And a growing family of source-available licences — BSL, SSPL, the Elastic Licence, n8n’s Sustainable Use License — is not open source at all.

This guide works through each family, then shows how to check a licence in practice. It is a practical reading guide, not legal advice; for a business-critical dependency, a lawyer reviews what a blog post summarises.

The comparison

Licence Family Use in a closed commercial product Must share your changes Hosted-service (SaaS) trigger Notes
MIT Permissive Yes No No Keep the copyright notice. The default for libraries
Apache-2.0 Permissive Yes No No MIT plus an explicit patent grant, a NOTICE-file duty, and a duty to state changes
BSD (2/3-clause) Permissive Yes No No MIT’s close cousin; 3-clause adds a no-endorsement rule
MPL-2.0 Weak copyleft Yes Only the MPL files you modified No Copyleft stops at the file boundary
LGPL Weak copyleft Yes, if you link without modifying the library itself Only for changes to the library No The library-friendly copyleft compromise
GPL-3.0 Strong copyleft Only if your product is also GPL Yes, when you distribute No — private hosting does not trigger it The distribution trigger is the key fact
AGPL-3.0 Network copyleft Only under AGPL terms Yes Yes — offering it over a network triggers sharing Written to close the GPL’s SaaS gap
BSL 1.1 Source-available Restricted — read the Additional Use Grant Varies Often restricted Converts to a GPL-compatible open licence on a Change Date, at most 4 years out
SSPL / Elastic Licence Source-available Restricted Varies Restricted by design MongoDB’s and Elastic’s answers to cloud resale
Sustainable Use License Source-available Internal use yes; selling the software itself, no No, for permitted uses Hosting it for others is the restricted case n8n’s “fair-code” licence; not OSI-approved

How we researched this

The summaries below follow the licence texts themselves, the per-licence condition lists at choosealicense.com (GitHub’s reference, checked November 2026), and the publishers’ own licence documents for the source-available family — including the BSL 1.1 parameters and the Sustainable Use License as n8n publishes it. Where a licence is a template with blanks to fill in — the BSL is the main one — the article says what to look for in the filled-in version.

Permissive: MIT, Apache-2.0 and BSD

Permissive means the code is a gift with a name tag. These licences let you build a closed, paid product on the code. Your obligations are small and specific.

MIT asks for one thing: keep the copyright and licence notice in copies of the software. No patent grant is written into it, no duty to publish changes, no restriction on commercial use. It is the most common licence in the JavaScript ecosystem and the default choice for libraries that want maximum adoption.

Apache-2.0 covers the same ground and adds three things. First, an express patent grant from every contributor — and the grant terminates for anyone who sues over patents in the project, which is why legal teams at larger companies often prefer it. Second, a NOTICE file duty: if the project ships one, its contents travel with your distribution. Third, modified files must carry a notice that you changed them. Apache-2.0 also states plainly that it grants no trademark rights.

BSD 2-clause and 3-clause sit beside MIT in effect. The 3-clause version adds a rule that the authors’ names may not be used to endorse or promote your product. None of the BSD variants contains an express patent grant.

Most of the infrastructure this site recommends sits in this family — and both of the projects showcased in our open-source directory do too — which is why a business can adopt such tools without a legal review per dependency. Permissive is not “no rules”; it is “rules you can comply with by keeping a text file intact.”

Weak copyleft: LGPL and MPL-2.0

Weak copyleft asks for something back, but fences the request so a commercial product can still stand around it.

LGPL is written for libraries. You may link an LGPL library into a closed product, including dynamically or, with extra conditions, statically. What you must share is the library itself: if you modify the library, your modifications to it go out under the LGPL, and users must be able to replace the library with their own build. Your application code stays yours.

MPL-2.0 draws the line at the file. Mozilla’s own summary is the clearest: the copyleft applies to any file containing MPL-covered code. Change an MPL file and distribute the result, and that file’s source stays available under MPL-2.0. Add new files that contain no MPL code, and those files can be proprietary — inside the same product, in the same binary. MPL-2.0 includes an express patent grant, and by default it is compatible with the GPL family unless the author marked the code “Incompatible With Secondary Licenses.”

The practical difference: LGPL thinks in libraries, MPL-2.0 thinks in files. Both let you sell a product that contains open code, as long as the covered part itself stays open.

Strong copyleft: GPL and the distribution trigger

Copyleft means the gift has a return address. GPL code can be used commercially — selling GPL software is allowed — but if you distribute a product containing it, the combined work’s source goes out under the GPL too, with the same freedoms you received.

The trigger is distribution, and understanding it dissolves most GPL anxiety:

If you are evaluating a self-hosted tool for internal use — the situation in the self-hosting guide — GPL is rarely the problem. It becomes the problem at the moment your product ships to customers with GPL code inside it.

Network copyleft: AGPL and the SaaS trigger

The GPL’s distribution trigger left a gap: a company could build a hosted service on GPL code, modify it heavily, and share nothing, because no copy was ever distributed. AGPL-3.0 exists to close that gap.

Its extra clause (Section 13) says that if you modify the program and let users interact with it over a network, you must offer those users the source of your modified version. Offering the software’s functionality as a service is the trigger — no download required.

This is the check that matters most for builders evaluating tools to run as a product. An AGPL database, analytics tool or automation engine inside your SaaS can put source obligations on the combined service, which is why many companies either buy the vendor’s commercial licence or choose a differently licensed tool. The self-hosted alternatives roundup flags AGPL where it appears for exactly this reason.

Source-available: BSL, SSPL, Elastic and the Sustainable Use License

Source-available is a different species. The code is public to read, but the licence restricts a class of commercial use — usually the use that competes with the publisher. None of these licences meets the Open Source Initiative’s definition, because that definition forbids discrimination against a field of endeavour. A tool under one of them is not open source, and listing it as such misleads exactly the evaluation this article is for.

BSL 1.1 (Business Source License) is a template, not a fixed text. The publisher fills in an Additional Use Grant (how far free production use extends), a Change Date, and a Change License. Its defining feature is the expiry: on the Change Date — which version 1.1 caps at four years after that version’s release — the code converts automatically to the Change License, which must be GPL v2 or later, or a GPL-compatible licence. HashiCorp’s Terraform is the well-known case: version 1.6.0 moved to BSL 1.1 in 2023 with MPL-2.0 as its Change License, so each BSL release becomes MPL code four years after it ships.

SSPL (Server Side Public License, MongoDB’s licence) extends copyleft to the whole service stack: offering the software as a service means offering the source of the management and hosting layers around it too. That breadth is why the OSI does not approve it. The Elastic Licence 2.0 takes the simpler route of prohibiting hosted-service offerings and licence-key circumvention directly.

The Sustainable Use License is n8n’s “fair-code” licence, and it is the one builders meet most often in the automation space. It permits use, copying and modification for your own internal business purposes or for non-commercial use, and free non-commercial distribution. It does not permit selling n8n itself, charging for access to an instance, or hosting it so your customers can build their own workflows — those need n8n’s commercial terms. Running n8n inside your own company, including on client work where the client controls their instance, is the permitted case. The Make vs Zapier vs n8n comparison prices n8n with this licence boundary in view, because it decides where the tool may sit in a product.

None of this makes source-available licences bad. They are how several good tools fund their development. It makes them a different input to a buying decision: read the restriction, and check the exit before you build on the tool.

When a project changes its licence

Relicensing follows one pattern, and knowing it removes the panic. A publisher can license future versions however it likes — it owns the copyright in its code, with contributors’ contributions the one complication (a CLA or DCO is how projects keep that option clean). It cannot retroactively revoke the licence on versions already released.

So when HashiCorp moved Terraform to the BSL, every release up to 1.5.7 stayed MPL-2.0 forever — and the community forked that last open version as OpenTofu, which continues under MPL-2.0. Existing users of a relicensed project keep their rights in the versions they already run. What changes is the future: new features arrive under the new terms, and staying on the last open version means owning its maintenance yourself, which is the trade priced in the maintenance-costs article.

Choose your own project’s licence as if it is permanent for everything you ship under it — because for those versions, it is.

Checking a licence in practice

  1. Find the LICENSE file at the repo root. No file means no licence — which in copyright law means all rights reserved, whatever the README implies. A repo without a licence is not open source, full stop.
  2. Match it against the table. The SPDX identifier in the file header or the repo sidebar (MIT, Apache-2.0, AGPL-3.0-only) names it exactly. If the licence is a filled-in template like the BSL, read the Additional Use Grant and the Change Date, not just the licence’s name.
  3. Check the dependencies that matter. Your product’s licence posture is set by the strictest component you distribute — one GPL library inside a shipped binary is a GPL obligation for that binary. Tools that generate a dependency inventory exist; even a spreadsheet beats memory.
  4. Write the inventory down. Component, version, licence. It is a short document, and producing it later — under a buyer’s due diligence or a platform review — is miserable by comparison. The licence check belongs in the repo-reading routine before you adopt a tool, not after.

Choosing a licence for your own project

The decision compresses into three questions:

Then do the mechanics properly: put the full licence text in a LICENSE file at the repo root, and state the SPDX identifier in your package metadata so scanners and humans read the same answer. If you plan to accept contributions and ever change direction, decide on a CLA or DCO before the first outside pull request, not after the fiftieth. And if you are building in public, the licence choice is part of the story you tell — the guide to building in public covers where it fits.

FAQ

Can I use this in my paid product? For MIT, Apache-2.0 and BSD: yes, with attribution kept. For LGPL libraries linked unmodified, and MPL-2.0 files you leave covered: generally yes, with the covered parts’ source shared. For GPL components you distribute: only if your product’s source ships under the GPL too — a business decision, not a detail. For AGPL components in a hosted product: the same, triggered by offering the service. For BSL, SSPL, Elastic or Sustainable Use code: read the specific restriction, because commercial and hosted use is exactly what those licences limit.

Is “fair-code” or “source-available” the same as open source? No. Open source, in the OSI sense, cannot restrict a field of endeavour such as selling hosting. Source-available licences publish the code and restrict exactly that kind of use. The software may still be excellent and free for your use case — but the label matters when you plan to build a business on it.

Can I change the licence of my own project later? For future versions, yes — you hold the copyright, subject to any contributor agreements you set up. For versions already released, no: everyone who took v1 under MIT keeps v1 under MIT forever. That asymmetry is why relicensing always applies to new versions, and why users pin the last open version and fork it.

A repo has no LICENSE file but the README says “free to use.” Which wins? The missing file. Without a licence, default copyright applies and the code is all rights reserved; a README sentence is not a licence grant you can rely on commercially. Ask the maintainer to add one, or treat the code as unavailable.

Does the AGPL apply if I only use the tool internally? Internal use with no outside users interacting over a network is the case AGPL was not written to catch; its trigger is offering the modified software’s functionality to users over a network. Internal-only deployment of an unmodified AGPL tool is the low-risk case — and the moment customers touch it, the analysis changes.

Conclusion

Three questions classify almost any licence you will meet: may I sell a product containing this, must I share my changes, and does offering it as a service change the answer? Permissive licences answer no, no, no. Copyleft answers with conditions that scale from a file (MPL-2.0) to a whole distributed work (GPL) to a network service (AGPL). Source-available licences answer “read the restriction” — and reward the reading, because their limits are specific, not vague. Ten minutes with the table above, per dependency that matters, is the cheapest legal review you will ever get. Start the habit on your next adoption with the 15-minute repo vetting routine.

Category: Open Source & Self-Hosting · Tags: #open-source #beginners #checklist

Next step: this article is part of Open Source guides, which covers the full topic from first setup to advanced use.

Related guides

Open Source & Building in Public

Self-Host These First: The Starter Order r/selfhosted Actually Agrees On

Ask r/selfhosted what to run first and you get fifty services at once. Underneath the noise there is a consensus order — Pi-hole, Uptime Kuma, Jellyfin, Nextcloud, Immich — with official hardware figures, the mini-PC maths, and the categories people later deleted.

13 min read

Open Source & Building in Public

The README That Gets an Open-Source Project Adopted: Structure From Real Installs

A README is a landing page for people who evaluate in ninety seconds and install in ten minutes. The structure that converts readers into users: the one-line verdict, a screenshot or demo, the five-minute install, honest limits, and the sections most READMEs waste.

12 min read

Open Source & Building in Public

Read a Repo Before You Install It: A 15-Minute Vetting Routine

Stars tell you a project was noticed, not that it is safe or alive. The 15-minute routine for vetting an open-source repo before it runs on your machine: maintenance signals, the install script, dependency weight, licence, and the exit test.

12 min read

Open Source & Building in Public

Self-Hosting Your First Project: What It Actually Involves, Start to Finish

Self-hosting trades a subscription for setup time and your own uptime. The honest walkthrough: picking a first project, the VPS or home-server decision, Docker basics, backups that exist before you need them, and the maintenance hour nobody budgets for.

14 min read