123DevOps··6 min read

What are open source, GNU, the MIT license, and the GPL?

A simple explanation of what a software license is, the difference between free software and open source, the GNU Project, and the MIT, Apache, GPL, and AGPL licenses.

Beginner

You download a library from GitHub, use it in your project, and move on. But every piece of public code comes with “rules of use.” Those rules are called a software license, and understanding the basics saves headaches for you and for your company.

Disclaimer: this article is educational and is not legal advice. For real decisions, especially at a company, talk to a lawyer or your legal team.

What is a software license?

When someone writes a program, that person (or their company) holds the copyright to the code, just like an author holds the copyright to a book. By default, nobody else may copy, change, or distribute that code.

A license is the permission the author grants: “you can use my code, as long as you follow these conditions.” Think of it as a lease: it says what is allowed, what is forbidden, and what your obligations are.

Heads up: public code without a license is not “free to use.” Default copyright applies, and you have no permission to reuse it.

Free software: the four freedoms

In 1983, Richard Stallman launched the GNU Project, aiming to build a completely free operating system. The name is a recursive acronym: “GNU’s Not Unix.” Shortly after, he founded the Free Software Foundation (FSF).

For the FSF, a program is free software when it guarantees four freedoms to its users:

  1. Run the program for any purpose.
  2. Study how it works and adapt it (which requires access to the source code).
  3. Redistribute copies.
  4. Distribute modified versions, so others can benefit from the improvements.

Notice: “free” here is about freedom, not price.

GNU/Linux: why that name?

A typical “Linux” system combines the Linux kernel (the core, created by Linus Torvalds in 1991) with many tools from the GNU Project, such as the Bash shell and the GCC compiler. That’s why the FSF advocates the name GNU/Linux. In everyday life, most people just say “Linux,” and that’s fine. Learn more in What is Linux.

Open source: same practice, different philosophy

In 1998 the Open Source Initiative (OSI) was founded and published the Open Source Definition, a list of criteria a license must meet to be considered “open source.”

In practice, almost every free software license is also open source, and vice versa. The difference is the motivation:

  • Free software focuses on ethics: users have the right to control the software they use.
  • Open source focuses on practical benefits: open code leads to better, more secure, collaborative software.

Permissive vs. copyleft licenses

There are two big families of licenses:

  • Permissive: let you do almost anything, including using the code inside a closed (proprietary) product. The main requirement is keeping the authorship notice.
  • Copyleft: if you distribute a modified version or a derived program, you must use the same license and release the source code. It’s like a shared recipe with one rule: “if you improve it and pass it on, share your version too.”
License Type Main obligation Example project
MIT Permissive Keep the copyright notice and the license text Node.js
Apache 2.0 Permissive Keep notices; includes an explicit patent grant Kubernetes
BSD Permissive Keep the copyright notice Go language
GPL (v2 and v3) Strong copyleft When distributing modified versions, use the GPL and release the source Linux kernel (GPLv2), Git
LGPL Weak copyleft Changes to the library itself stay LGPL, but programs that just use it may have another license (with some conditions) glibc
AGPL Network copyleft If users access the modified version over a network, the source must be offered too Grafana, Mastodon

The AGPL exists to close a loophole: under the GPL, a company can modify the code and offer it as an online service without “distributing” anything. Under the AGPL, network use also triggers the obligation to share.

What about “source-available”?

Some licenses let you read the code but add restrictions, such as forbidding a competing service. Examples include the BSL (Business Source License) and the SSPL. They are not OSI-approved, so they are not open source. Terraform’s switch to the BSL in 2023 is what led to the creation of OpenTofu, as told in Terraform or OpenTofu: what changes.

I used MIT code. Now what?

The obligation is simple: keep the copyright notice and the license text with the code or the product. An MIT LICENSE file starts like this:

MIT License

Copyright (c) 2026 your-user

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software ...

Many projects also use an SPDX identifier, a standardized tag at the top of each file that states the license:

# SPDX-License-Identifier: MIT
# Copyright (c) 2026 your-user

Practical tips for companies

  • Know what you use: every dependency has a license, and so do the dependencies of your dependencies.
  • Use license scanning tools: there are open and commercial options, such as ScanCode and FOSSA.
  • Watch out for GPL and AGPL: if the product is shipped to customers or offered as a service, involve legal before using them.

How to choose a license for your project

The choosealicense.com site, maintained by GitHub, explains the options in plain language. In short:

  • Want anyone to use it, even in closed products? MIT or Apache 2.0.
  • Want to make sure distributed improvements stay open? GPL.
  • Is it a web service and you want the same effect? AGPL.

To check the license of a project you’ve already cloned, run this inside its folder:

# Show the license text (some projects use LICENSE.md or COPYING)
cat LICENSE

# Search for SPDX identifiers in the files (show only the first 10)
grep -rn "SPDX-License-Identifier" . | head -n 10

Try it yourself

  • Open three repositories you use on GitHub and write down each one’s license (it appears in the page sidebar).
  • Run cat LICENSE in a cloned project and find the author’s name and the year.
  • Explain in your own words the difference between a permissive and a copyleft license.
  • List the four freedoms of free software without looking at the article.
  • Visit choosealicense.com and pick a license for a personal project.
  • Add a LICENSE file and an SPDX comment to one of your repositories.

Next steps

Reading the license before using code is like reading the label before taking medicine: it takes two minutes and prevents a lot of trouble.

Get updates on new posts and stay in the loop!