GNU General Public License v2.0, explained

Strong copyleft GPL-2.0-only · GPL-2.0-or-later

GPL-2.0 is a strong copyleft: if you distribute software that includes or links GPL-2.0 code, the whole program must be distributed under GPL-2.0, with its source code.

Not legal advice. Read the licence text for the exact terms.

What it allows

  • Use, study, change and run the code for any purpose
  • Sell copies, under the GPL

What it requires

  • Distribute the complete corresponding source code with binaries (or a written offer for it)
  • License the whole combined work under GPL-2.0
  • Keep notices and include the licence
  • Not add restrictions on recipients' rights

When it matters

Shipping an app (desktop, mobile, on-premises)If your app includes or links the code, the combined work must be offered under the same GPL version, with its complete source code. A closed-source app cannot do that.
A hosted service (SaaS)Running the code on your own servers is not distribution: the GPL does not require you to publish your source. It does if you ship code to users, such as JavaScript bundles, desktop agents or an on-premises version.
Internal useAllowed with no conditions while the software stays inside your organisation (contractors working for you included, in the usual reading).

Its family: strong copyleft

If you distribute software that includes or links this code (an installer, a mobile or desktop app, a container image you hand out, JavaScript sent to browsers), the whole combined work must be offered under the same licence, with its source code. Running it only on your own servers is not distribution.

Questions

Can I use GPL libraries in a commercial app?

You can sell GPL software, but a closed-source app that includes or links GPL code and is distributed cannot keep its source closed.

What is the difference between GPL-2.0-only and GPL-2.0-or-later?

"Or later" lets recipients use the terms of GPL-3.0 instead, which matters for compatibility: GPL-2.0-only code cannot be combined with GPL-3.0 code.

Other licences

Published ; awaiting review.