Does there exist an open source license like GPL, GPLv2, BSD and so on which allows author to prohibit usage of the licensed software in some country?

  • 27
    Such a license definitely would not meet the OSI definition of Open Source, nor the FSF definition for Free Software. Mar 11, 2022 at 12:16
  • 2
    Note that even if such a prohibition exists, it would be functionally unenforceable (International IP law is a complicated mess), and would only realistically hurt normal, upstanding users and not those who want to use it for some malicious reason (if they are already looking at ‘misusing‘ it, an extra block of text in a file they probably do not even read is not going to stop them). Mar 13, 2022 at 2:30

6 Answers 6


For the GPL "family" of open source licenses, the answer is no.

The GPL FAQ answers a closely related question:

I'd like to license my code under the GPL, but I'd also like to make it clear that it can't be used for military and/or commercial uses. Can I do this? (#NoMilitary)

No, because those two goals contradict each other. The GNU GPL is designed specifically to prevent the addition of further restrictions. GPLv3 allows a very limited set of them, in section 7, but any other added restriction can be removed by the user.

More generally, a license that limits who can use a program, or for what, is not a free software license.

I'd also recommend looking into "Why programs must not limit the freedom to run them" (the page linked by the FAQ).
Stallman there argues (among other lines) that copyright is about limiting, well, copies rather than running the program. Similar to limiting the production of copies of a book as opposed to restricting what you are allowed to do with the information contained in the book. (I may add: or restricting who is allowed to read it.) Also, "Imagine selling pens with conditions about what you can write with them."

(So this is basically the FSF's position)

The OSI definition of what requirements a software license must meet in order to be considered open source by them has relevant clauses:

    1. Free Redistribution
      (though this says that anyone can distribute the software, it does not directly talk about restricting to whom the software may be given)
    1. No Discrimination Against Persons or Groups
    1. No Discrimination Against Fields of Endeavor

The OSI has a newsletter post "Open Source responds to the Russia-Ukraine war: First thoughts from the Executive Director", which links to a further discussion on the topic. This is more about politics and ethics than legal questions. However, I think it's relevant in 2 ways:

  1. For the situation at hand: They point out that while the open source definitions do not allow the license to have such restrictions, there is nothing that forces you (or a repository provider) to serve "customers" from all regions worldwide. I.e., geoblocking downloads is not prohibited by the FOSS licenses.

  2. It does show that there is a discussion on licenses that are somewhat more restrictive than the current open source definitions. As David Siegel points out, there's nothing to keep you from putting such restrictions into a proprietary license. And if there are sufficiently many people who want to do that, we may see "more restricted open source" licenses in the future.
    (IANAL, but I'd expect there may be limits to what can be restricted in a boilerplate license wrt. anti-discrimination laws.)

Independently of what the license allows, people are anyways bound by general law, e.g. sanctions.

  • It's a good answer, but it's missing one (obvious, but perhaps not to everyone) thing: piracy. Even if you were to forbid someone from using your program, in practice they can still use your program. The only thing you can do then, is to try to punish them for it.
    – user31389
    Mar 11, 2022 at 23:23
  • @user31389: The Stallman post does talk about enforceability. All in all, I'd think that discussion would get us into quite a rabbit hole: does prohibit use in country would mean: if I'm resident somewhere else, and go to that country taking a laptop with me, I need to make sure I don't execute that program while there... On the one hand, entirely impractical. On the other hand, my experience with FOSS is that potential industry users were scared away by GPL due to copyleft - I still think it wouldn't have restricted the use case they described, but their legal department decided "too risky". Mar 11, 2022 at 23:31
  • ... so I'd expect software with non-standard restrictions to be even more scary in practice. That is, to people who care about the license. So you'd scare away "good" users [and potential contributors], and whoever doesn't care about the license terms will anyways pirate copy. You may be able to do it legally, but IMHO it wouldn't be wise. Besides, clauses that put restrictions to groups of people ("must not be given to citizens of X") may violate anti-discrimination laws (Art. 3 German basic law: "No person shall be favoured or disfavoured because of [...] homeland and origin [...]) Mar 11, 2022 at 23:45
  • @cbeleites "*there may be limits to what can be restricted in a boilerplate license wrt. anti-discrimination laws." At least under US laws, a software license is not a public accomodation, and so the anti-discrimination laws do not apply. Mar 12, 2022 at 15:41
  • 1
    @DavidSiegel: In Germany, a license is a mass contract, and thus directly bound by anti-discrimination law (gesetze-im-internet.de/englisch_agg/englisch_agg.html#p0101). Interestingly, ethnicity is protected both by AGG and basic law, while homeland appears only in the by basic law list of protected categories. Still, courts are bound by the basic law also for civil cases ("indirect 3rd party effect of constitutional rights"). IANAL, but my conclusion is that substantial care may be needed to arrive at a license clause that could stand a court case. Anyways, I'm getting off-topic... Mar 12, 2022 at 19:06

Frame challenge: why would you want to implement such a restriction with a license? If relevant laws/sanctions prevent conveying the software to a party in or associated with Russia (or whatever nation), they already do that without you writing such a restriction into your license.

If your goal is to impose your own sanctions beyond the law in the relevant jurisdiction, you could write your own such license (or modify an existing one) that grants the permissions to copy and distribute, etc., only as long as the recipient is not [whatever]. As others have noted, this would not be an Open Source license, as the term "Open Source" is a trademark was launched with an intent to be a trademark, which apparently didn't materialize, but still carries with it a very specific defined meaning among people who use the term which excludes the kind of restrictions you're asking for. It would also not be very effective, since anyone in the jurisdiction you're trying to sanction is not subject to the laws of your jurisdiction. In theory you could try to find out who gave it to them and sue that person for copyright infringement, but it's unlikely you would be able to obtain evidence of that unless they just publicly admitted it.

In short: license terms are relevant only to parties who have reason to want to follow the laws in the relevant jurisdictions.

Update on "trademark" issue: While Open Source is not a trademark, the Ninth Circuit just affirmed a ruling that calling software Open Source when it doesn't meet the definition is false advertising.


As this answer and this comment point out, such a license would not be an open source license, nor a free software license as those terms are usually defined.

I am not aware of any standard or widely used permissive license that includes such a restriction, or an option for adding one. A license including such a restriction could be written, perhaps by starting with some open source or permissive license and modifying it. However, I do not see any practical way to enforce such a restriction.


Does there exist an open source license like GPL, GPLv2, BSD and so on which allows author to prohibit usage of the licensed software in some country?

Nope. And it's for the same reason you can't put a "license page" in a book that stops people from reading it in Arkansas.

A person who possesses a lawfully-made copy of your work already has the right to use it anywhere just as a person who possesses a lawfully-made copy of a book already has the right to read it anywhere. To take a right away from someone, you must offer them something in exchange and obtain their agreement to the exchange. A simple license doesn't do that.

You might be able to do this with a shrink wrap or click-through agreement. But you can't do it with just a license. It is not sufficient to say that they can't use it in Russia -- you must get them to actually agree not to use it in Russia and you must offer them something in exchange for that agreement.

  • 1
    I am reasonably sure that this is incorrect. The same argument could be made agaisnt a "no-commercial-use" license. A would-be commercial user has (or may have) a lawful copy of the software. But such license clauses are generally conceded to be binding. One hs no right to use software except in accordance with permission, normally via a license. That license may set conditions on use, just as it may set conditions on re-distribution. The real problem with such a license is enforcability. One would need to identify violators, and then bring legal action in courts that have jurisdiction. [...] Mar 12, 2022 at 21:13
  • [...] Russian court might well not enforce such restrictions. A dev could add code which required registration and disables the software if the registered address was in Russia, or if the IP address of the "phone home" access geo-located to Russia, but such measures would not be too hard to bypass. In any case, those are technical, not legal, methods of control. One might also question whether any such restriction would in any significant way deter Russian aggression in Ukraine. Mar 12, 2022 at 21:18
  • 1
    "One hs no right to use software except in accordance with permission, normally via a license." That is simply not correct. The list of things one needs permission to do as rights of the copyright holder is specified by law. In the US, it's 17 USC 106. You will notice that ordinary use is not one of those things. Under US law, ordinary use is a right of lawful possession. If you own a lawfully-made copy of a book, you can read it. If you were right, you'd need a license to read a book you owned. Mar 12, 2022 at 21:35
  • 2
    @DavidSiegel A CC-BY-NC license is not binding on someone who merely lawfully possesses and uses the work. It's binding on someone who distributes it. If you read the license carefully, you'll see that it says things like "reproduce and share ... for non-commercial purposes only". It doesn't try to restrict ordinary use. the claim that software is "normally distributed so that the user does not ever own a copy" is false. That is the much less common means of distribution and has nothing to do with work subject to ordinary licenses. Mar 12, 2022 at 23:24
  • 1
    @DavidSiegel I would also point out that most of the discussion about the other question is inapplicable because it either deals with use not considered ordinary use of a copyrighted work (such as commercial use) or talks about shrink-wrap or click-through licenses (such as VMWare's license) that you must affirmatively agreed with to access the work. As I explained, you cannot restrict ordinary use with a license that merely accompanies the work because nothing compels anyone to agree to the license and they still have the right to ordinary use by law. Mar 13, 2022 at 0:41

You might be able to make it illegal for Mafia or drug dealers to use your software (or not), but they’ll just laugh about it. But a nation state can just change its IP laws and use the software ”legally”.

  • It doesn't even need to do that. Sansctions are assumed legal by state who made them. They are usually considered illegal by state which are against. So no need to violate anything by anybody who is under jurisdiction of sanctioned state.
    – Tauri
    Jul 29, 2022 at 16:29

No; by definition, of course not.

Some kind of "semi-open" licence might do all sorts of things and in the context of this Question, where did the "semi…" bit come from?

  • 1
    This seems better as a comment than as an answer, if it should be posted at all.
    – Mast
    Mar 13, 2022 at 20:54
  • @Mast Sorry. Some things really are that simple. Mar 13, 2022 at 20:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .