Using copyright to protect freedom
Copyleft is a play on the word copyright. It is a concept created in the 1980s by Richard Stallman and the Free Software Foundation (FSF) for the GNU Project, and it is a mechanism that uses copyright law to keep software freedom from disappearing. The copyright holder permits anyone to use, modify and distribute the software, with one condition: "When you distribute something based on this code, you must give recipients the same freedoms."
Permissive licenses (MIT, BSD, Apache) do not have this condition, so someone can modify permissive code and sell it as a closed product. Copyleft blocks that path, keeping improved versions open as well. Because of this property, copyleft licenses are also called "reciprocal" licenses.
Obligations arise when you distribute
Copyleft conditions are triggered when you pass the code on to someone else. GPL-3.0 calls this "convey".
- If you build an internal tool with GPL code and do not distribute it outside your company, there is no obligation to disclose the source.
- Handing out an installer to customers or selling it built into a device counts as distribution.
- Running it only on a server that users access via the web is not distribution under the GPL. The AGPL fills this gap.
Three branches by scope
Strong copyleft
GPL-2.0 and GPL-3.0 are the main examples. Everything combined with GPL code and distributed as a single program must follow GPL terms. The FSF's position is that static or dynamic linking counts as combination if the result forms one program.
Weak copyleft
Licenses that narrow the scope of the obligation.
- LGPL: Library level. Only changes to the library itself must be published, and programs that use it can stay closed if they meet the conditions (such as allowing relinking).
- MPL-2.0: File level. If you modify files covered by the MPL, only those files are published.
- EPL-2.0: Module level. EPL code and its modifications are published, but separate modules can use other licenses.
Network copyleft
AGPL-3.0 imposes the obligation to provide source to users merely by providing a modified program over a network. It was created to fill the GPL's gap in the age of web services.
| License | Disclosure scope | When only running a server |
|---|---|---|
| GPL-2.0 / GPL-3.0 | The whole combined program | No obligation |
| LGPL-2.1 / LGPL-3.0 | The library and its modifications | No obligation |
| MPL-2.0 | Modified MPL files | No obligation |
| EPL-2.0 | EPL code and modifications (module) | No obligation |
| AGPL-3.0 | The whole combined program | Provide source if modified |
Common misconceptions
- "Copyleft prevents commercial use" — It does not. You may sell GPL software, and many companies make money from paid support and hosting. What it prevents is taking away recipients' freedoms.
- "Looking at even one line of GPL code makes my code GPL" — Licenses deal with copying, modifying and distributing works. Getting ideas from reading code is not itself subject to copyright. However, if you effectively transcribe it, that may be considered copying.
- "If I violate it, my code automatically becomes GPL" — The usual consequences of a license violation are loss of rights and liability for copyright infringement. Your code is not forcibly published; you choose to either comply with the conditions or stop distributing.
- "Copyleft code can never be used in permissive projects" — It means that if you combine and distribute them, the combined work follows copyleft terms. There are ways around it, such as keeping it as a separate program or linking a weak copyleft library in compliance with its conditions. See compatibility basics.
Questions to decide whether to choose copyleft
- Is it okay if modified versions of your code end up in closed products?
- Is wide adoption as a library more important, or getting improvements back?
- Is the main usage installed software, or a service running on a server?
Based on your answers to these three questions, the license wizard narrows down the candidates. A more detailed comparison is in Permissive vs copyleft.
This article is general information, not legal advice. Consult a professional for important decisions.
Sources
- GNU — What is Copyleft? — https://www.gnu.org/licenses/copyleft.html
- GNU license FAQ — https://www.gnu.org/licenses/gpl-faq.html
- GNU GPL v3.0 text — https://www.gnu.org/licenses/gpl-3.0.html