Understanding Open Source Licenses
You will know the basic rules that govern how open source software is shared.
Knowledge of Computers › Concept of Open Source Technologies · 20 min read
In the previous chapter, we looked at some of the most popular open-source software in the world—tools like the Linux operating system, the VLC media player, and the Mozilla Firefox browser. You now know that the source code for these massive, world-changing projects is freely available for anyone to download, read, and modify.
But this raises a massive question: if anyone can download the code for Linux, what stops a giant tech corporation from downloading it, changing the name, locking up the code, and selling it as their own private, proprietary product?
The answer is: Open Source Licenses.
A common misconception among students is that "open source" means "public domain" or a lawless free-for-all where there are no rules. This is completely false. Open source software is heavily regulated. It relies on strict legal documents called licenses to ensure that the software remains open, or to dictate exactly how developers are allowed to use it.
In this chapter, we are going to dive deep into the legal engine that powers the open-source world. We will break down the difference between "Copyleft" and "Permissive" licenses, and we will look closely at the three most important licenses you will encounter in your exams: the GNU General Public License (GPL), the MIT License, and the Apache License.
The Myth of the Lawless Free-for-All
To understand open-source licenses, we first have to understand standard copyright law.
When a programmer writes a piece of code, they automatically own the copyright to that code. Just like a novelist owns the rights to their book, or a musician owns the rights to their song, a programmer owns their code. By default, copyright law says: "All rights reserved. Nobody else can copy, modify, or distribute this work without my explicit permission."
If a programmer wants to share their code with the world, they cannot just put it on the internet and say "have fun." Legally, if there is no explicit permission attached to the code, other developers cannot safely use it, because the original author could sue them for copyright infringement later.
To give this permission, the author attaches a License.
Open-source software uses licenses to flip traditional copyright on its head. Instead of using copyright to lock software down, open-source developers use copyright to guarantee that the software can be shared.
However, not all open-source developers have the same philosophy about how their code should be shared. This disagreement has split the open-source world into two major legal camps: Permissive licenses and Copyleft licenses.
The Great Divide: Permissive vs. Copyleft
If you understand the difference between Permissive and Copyleft, you will understand 90% of how open-source licensing works. Let us break them down using a simple, real-world analogy: baking a cake.
Imagine I have invented a recipe for the most delicious chocolate cake in the world. I decide I want to share this recipe with the public, rather than keeping it a secret.
The Permissive Approach
If I release my recipe under a Permissive License, I am saying: "Here is my recipe. Do whatever you want with it. You can bake the cake for your friends. You can change the recipe by adding walnuts. You can even take my recipe, bake the cakes, and sell them in your bakery for a profit. You don't even have to tell your customers what the recipe is. The only rule is: you must leave my name on the original recipe card so people know I invented the base version, and you cannot sue me if the cake gives you a stomach ache."
Permissive licenses are all about maximum freedom for the developer who downloads the code. They can take open-source code, modify it, and turn it into a closed, proprietary, paid product.
The Copyleft Approach
If I release my recipe under a Copyleft License, I am saying: "Here is my recipe. You can bake the cake, you can add walnuts, and you can even sell the new walnut cake in your bakery. BUT, there is a catch. If you sell or distribute a cake based on my recipe, you must give your customers the new recipe (including your walnut addition) under these exact same rules. You cannot keep your modified recipe a secret."
Copyleft licenses are all about maximum freedom for the end-user. They ensure that if a piece of software starts as open-source, any modified versions of it must also remain open-source.
Deep Dive: Copyleft and the "Viral" Effect
Let us look closer at Copyleft. The word itself is a clever pun on the word "Copyright." While copyright restricts the right to copy, copyleft guarantees the right to copy and modify—but with strings attached.
The core mechanism of a copyleft license is a legal clause that states: If you modify this software and distribute it to others, you must release your modified version under the exact same license.
Because of this rule, copyleft licenses are often described in the tech industry as "viral" licenses. Just like a virus spreads by attaching itself to a host, a copyleft license spreads by attaching itself to any new code that gets mixed with it.
The Copyleft Lifecycle
- 1Developer A writes a basic calculator app and releases the source code under a Copyleft license.
- 2Developer B downloads the code, adds a new scientific graphing feature, and decides to sell the app.
- 3Because Developer B distributed the app, the Copyleft license is triggered.
- 4Developer B is legally forced to publish the source code for their new graphing feature for free.
- 5Developer C can now download the advanced graphing calculator code, add more features, and the cycle continues.
Why do developers use Copyleft? It is a defense mechanism. It prevents large corporations from taking the hard work of volunteer open-source developers, adding a few minor tweaks, and locking it behind a paywall without giving anything back to the community. If a corporation uses copyleft code in their product, they are legally obligated to share their own proprietary code with the world.
The Big Three Licenses
There are dozens of approved open-source licenses, but in the real world—and in your exams—three licenses dominate the landscape. You need to know the names, the categories, and the unique quirks of the GNU General Public License (GPL), the MIT License, and the Apache License.
1. The GNU General Public License (GPL)
Category: Strong Copyleft
The GPL is the granddaddy of all open-source licenses. It was written in 1989 by Richard Stallman, a programmer at the Massachusetts Institute of Technology (MIT) who founded the Free Software Foundation.
Stallman was famously frustrated when a new printer in his lab kept jamming, and he couldn't fix it because the manufacturer had locked the source code for the printer driver. He believed that hiding source code was unethical, so he created the GPL to ensure software would always remain free and open.
The GPL is the most famous Copyleft license in the world. Its rules are strict:
- You can use, copy, and modify the software for any purpose.
- You can distribute the software (even charge money for the service of distributing it).
- The Catch: If you distribute the software, or any modified version of it, you must make the complete source code available to the recipients under the exact same GPL license.
Famous Example: The Linux operating system kernel is licensed under the GPL (specifically, version 2 of the GPL). This is why Linux has grown so massive. Every time a massive company like IBM or Intel modifies the Linux kernel to work better on their hardware, the GPL forces them to share those improvements with the rest of the world.
2. The MIT License
Category: Permissive
If the GPL is a strict, multi-page legal contract, the MIT License is the exact opposite. Created at the Massachusetts Institute of Technology, it is one of the shortest, simplest, and most popular licenses in the world. It is usually only a few paragraphs long.
The MIT License is a Permissive license. It essentially says:
- You can do whatever you want with this code. You can use it, copy it, modify it, merge it, publish it, distribute it, and sell it.
- You can take this open-source code and put it into a closed-source, proprietary product.
- The Catch: You must include a copy of the original MIT license text and the original author's copyright notice in your software. (This is just giving credit).
- The Protection: The software is provided "as is", without any warranty. If the code breaks your computer, you cannot sue the original author.
Because it is so incredibly flexible, the MIT license is beloved by modern web developers. It removes all legal friction. A startup can use MIT-licensed code to build a billion-dollar commercial product without ever having to reveal their own secret source code.
Famous Examples: The React user interface library (created by Facebook) and the jQuery JavaScript library are both distributed under the MIT License.
3. The Apache License (Version 2.0)
Category: Permissive (with Patent Protection)
The Apache License was created by the Apache Software Foundation. Like the MIT license, it is a Permissive license. You can take Apache-licensed code, modify it, and use it in closed-source, proprietary products without having to share your new code.
So, why does the Apache License exist if the MIT license already does the same thing? The answer is Patents.
In the software world, a copyright protects the exact written code, but a patent protects the underlying idea or invention behind the code. In the early 2000s, a major problem emerged: a company would release open-source code, wait for other businesses to start using it, and then suddenly sue those businesses for patent infringement, claiming the code used their patented inventions.
The Apache License 2.0 was written to stop this trap. It includes an express grant of patent rights.
- When a developer releases code under the Apache License, they are legally promising: "I grant you a license to use my copyrights, AND I also grant you a license to use any of my patents that are inside this code."
- It also includes a patent retaliation clause: If you use Apache-licensed code, and then you try to sue the original creators for patent infringement, you immediately lose your right to use the code.
Because of this robust legal protection, the Apache License is heavily favored by massive tech corporations who want to share code safely without risking billion-dollar patent lawsuits.
Famous Examples: The Android Operating System (the core of it) and the Kubernetes cloud computing system are licensed under the Apache License.
Comparing the Big Three
To help you lock in these concepts for the exam, let us compare how these three licenses handle different scenarios side-by-side.
- Can I use the code for commercial purposes (to make money)?
- GPL: Yes.
- MIT: Yes.
- Apache: Yes.
- Can I modify the code?
- GPL: Yes.
- MIT: Yes.
- Apache: Yes.
- If I modify the code and distribute it, do I HAVE to share my new source code?
- GPL: Yes. (This is the Copyleft rule).
- MIT: No. You can keep your new code secret.
- Apache: No. You can keep your new code secret.
- Does the license explicitly protect me from patent lawsuits by the creator?
- GPL: Yes (in version 3).
- MIT: No. (It only covers copyright, not patents).
- Apache: Yes. (This is its defining feature).
Worked Example: Choosing a License
Let us walk through a practical scenario to see how these licenses dictate real-world business decisions.
Imagine you are a software developer working for a private company. Your boss asks you to build a new mobile application for the company to sell. To save time, you want to use some pre-existing open-source code you found on the internet.
Scenario A: You find a great piece of code under the MIT License. You download the code, modify it, and integrate it into your company's app. When the app is finished, your company sells it on the App Store for ₹500. Is this legal? Yes. Because the MIT license is permissive, you are fully allowed to use it in a commercial, closed-source product. You just need to include a small text file in the app's settings menu giving credit to the original MIT code author. Your company keeps its own code completely secret.
Scenario B: You find a great piece of code under the GPL (Copyleft). You download the code, modify it, and integrate it into your company's app. When the app is finished, your company sells it on the App Store for ₹500. Is this legal? Yes, you can sell it. BUT, because you distributed a product containing GPL code, the viral nature of the GPL is triggered. Your company is now legally obligated to publish the entire source code of your new mobile application for anyone to download for free. The Result: Your boss will likely be furious. Competitors can now download your company's source code, compile it, and release a free clone of your app. This is why commercial software companies are extremely careful about never accidentally including GPL code in their proprietary products.
Quick Revision
Here are the high-yield facts you must remember for your exam:
- Copyright vs. License: Copyright automatically restricts sharing; an open-source license is a legal document that grants permission to share, use, and modify.
- Permissive Licenses: Allow developers to use open-source code in closed-source, proprietary products. They offer maximum freedom to the developer.
- Copyleft Licenses: Require that any modified versions of the software must also be released as open-source under the same license. They offer maximum freedom to the end-user.
- Viral License: A common nickname for Copyleft licenses (like the GPL) because the open-source requirement "infects" any new code it touches.
- GPL (GNU General Public License): The most famous Copyleft license. Created by Richard Stallman. Used by the Linux kernel. Forces downstream sharing.
- MIT License: A very short, highly Permissive license. "Do whatever you want, just give me credit and don't sue me." Used by React and jQuery.
- Apache License: A Permissive license designed for corporate safety. It explicitly grants patent rights to protect users from patent infringement lawsuits. Used by Android.
- OSI (Open Source Initiative): The organization that defines and approves official open-source licenses.
Related notes
- What is Open Source Software?
You will understand what source code is and why the open source model matters.
- Open Source vs Proprietary Software
You will learn how open source differs from paid, closed, and free software.
- Popular Open Source Software Examples
You will recognize the most common open source applications asked about in exams.
- Pros and Cons of Open Source
You will be able to list the main benefits and drawbacks of using open source tools.