So, I wrote a little piece of software (really little piece of software) and I want to open source it using Apache License for EVERYBODY but for a company, for that company I want the license to be GPL.

Is this possible? If so how should I implement this? I just add a License section in the github readme explaining that is open source for everybody but for "This Company"?


Theoretically, you can do that. But practically, it won't work.

When you license something as open source, you don't necessarily need to license it to everyone. You can choose to only license it to a selected audience.

But any open source license includes an unlimited right to sub-license. That means anyone who receives a copy under the Apache license can sublicense it under the same conditions to anyone they want, including "This Company", and there is nothing you can do against it (not as long as you still want to call your software Open Source and its license the Apache license).

You are of course free to create an own crayon license based on the Apache license which forbids redistribution to "This Company". It's your work and you alone can decide who can use it and for what. But when you make use of your copyright in this way, please do not call it open source.


Two licenses in one repository is something that can be done. This is known as dual licensing and typically is the case when an author wants to release software under different licenses so that it can be used in projects that are restrictive (a BSD project can't include GPL code - so an author may wish to release under BSD and GPL).

However, a key part of the open source definition is "No Discrimination Against Persons or Groups" - you can't restrict a company from using the software under Apache if it is available to them under that license. So, to the question of "licensing to one company under GPL and everyone else under Apache" - no, you can't do that, or rather you can't do that in a way that has any teeth.

Something else that is occasionally done is that one may release publically under one license (say AGPL) and than offer the ability for organizations to pay to receive the license under another (less restrictive) one. An example of this can be seen with iText, which releases their software under AGPL, but provides another license for companies that wish to use a different license that isn't as restrictive (and is presumably, not an open source license).

  • Awesome! thanks a lot for taking the time to explain that! – Andres Nov 2 '15 at 19:01


One of the fundamental principles of open source software is "no discrimination" - you can't have one licence for some entities and another one for others. If you want to release your software under the Apache licence to some entities, you have to release it under that licence to everybody.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.