tags:

views:

117

answers:

4

I would like to make some source code publicly available, but prevent it from being used for commercial purposes. Which license should I use? And more importantly, are there any measures I can take to prevent, discourage or detect commercial use?

Or should I simply accept that if I make the source code publicly available it might be used for commercial purposes?

+1  A: 

Check out "What Open Source License to Choose".

Will A
+4  A: 

For software to meet the definition of "open source" (by almost anyone's definition of "open source"), it can't discriminate against commercial use. (See, for example, item 6 of the Open Source Definition.)

If you want to make the source code available and prohibit commercial uses, then you ought to be able to find an appropriate (non-open source) license. The Creative Commons have a few license variants that prohibit commercial use; although they discourage using their licenses for software, there's no reason you can't.

In practice, licensing your software under the GPL (or the AGPL, for web apps) will generally discourage (but not prohibit) commercial use, since commercial software is often unwilling or unable to comply with the GPL's requirements.

Edit in response to the Creative Commons comments: From what I can tell from sites like this, this, and this, CC is discouraged for the following reasons:

  1. It's not GPL compatible, which makes using it in open source projects difficult.
  2. License proliferation is a problem in the open source world; using CC for software would worsen this.
  3. The CC licenses aren't written for software, so applying them to software is a bit murky.

Edit in response to your clarification: I don't think that trying to enforce an anti-commercial clause will work. There are various techniques you can try - restrictions on who can download the code, "phone home" logic embedded within the code, obfuscation, etc. - but all of this can be circumvented. (E.g., download the code once and then post it to a public site, rip out the phone home logic, reverse engineer the obfuscation, etc.)

More fundamentally, I assume that you're making your source code available so that people can use it. This is already a bit of an uphill battle - you have to convince people to use your code out of all of the hundreds of millions of lines of source code available, and to use your code instead of just writing something themselves. Any anti-commercial logic that you add - such as obfuscation, or "phone home" logic, or restrictions on who can download the code - will make the code that much less valuable to use, and I suspect that for most code it wouldn't take much for people to decide it's just not worth it.

Given the problems with enforcing a no-commercial use clause, your best option might be to choose an open source license like the GPL or AGPL that permits commercial use but makes it an unattractive option for many companies. This way, you gain the benefits of being a part of the open source community, including the potential help of folks like the SFLC and gpl-violations.org in finding and dealing with anyone who does violate your license.

Josh Kelley
Clarified question and removed the open-source tag.
hgpc
Also I don't really understand why Open Source implies free. I posted a separate question about it: http://stackoverflow.com/questions/3485839/why-is-open-source-free
hgpc
Especially GPL 3
LeonixSolutions
+1. If I had read the edit more carefully I probably needn't have posted a redundant answer. :-)
ShreevatsaR
+1 Thank you Josh for such a detailed answer.
hgpc
A: 

You may use a Creative Commons License with a "no commercial use" clause. You may also use a proprietary license which expressly forbids commercial use (hint: start with an accepted license, and then add a superseding clause specifying no grant of use for commercial purposes).

Depending on how strongly you want to prohibit commercialism, a viral license like the GPL might also be sufficient; although a company can still make money off of your code, with the GPL, a competitor could take the source and provide the same program for free. If it's a web app, use the AGPL.

You should note, however, that if you prohibit commercial use, your code is not free. If you really want it to be open and free-as-in-libre, use a license like the MIT license, which does not discriminate based on usage type.

Borealid
As Josh Kelley mentions, CC is discouraged for software by the very own Creative Commons corporation, though I don't know why.
hgpc
+4  A: 

Please don't try to prevent commercial use; it's against the spirit of open-source.1 It's worth thinking about what exactly your motivations for wanting to prevent commercial use are.

There are "three levels" of open-source licenses, which you could use depending on what your intentions are (Credit: Dave Johnson):

  • Level 1 (permissive): I don't want others to use my work without giving me credit: These licenses (Apache License, BSD, MIT) say "You can use, modify and redistribute my code in your product, but give me credit". This allows using your work in commercial, proprietary closed-source software.

  • Level 2: I don't want others to make improvements based on my work and not give them back: These licenses (Mozilla Public License, CDDL, LGPL) say "You can use, modify and redistribute my code in your product but give me the source for any fixes you make to it." This allows using your work in commercial, proprietary closed-source software, but any improvements they make to "your part" will always be available to everyone for free.

  • Level 3 (copyleft): I don't want others to use my work in non-free software: These licenses (GPL, mainly) say: "You can use, modify and redistribute my code in your product but release your entire product's source code." This allows others to make improvements to your work, whether for commercial or whatever reasons, but any improvements they make and distribute will always be available to everyone in source form for free. It does not prevent them from selling the software (on CDs, say) or making money out of supporting it.

Note that "I don't want others to make money" is not one of these options. But if your motivation is to avoid feeling "ripped-off" by a commercial company "stealing" your code, the GPL is what you should use. By not preventing commercial use, you're increasing the chances that your software may be used by others. If you prevent commercial use, it's no longer an open-source license, and other open-source programmers may not be willing to work on it or be able to use it in open-source software.

[General note: Whatever license you use, nothing prevents a company from contacting you and getting your code under a non-GPL license — you can charge them a fee to allow them to make a proprietary derivative of your code, if you want. (As long as your code is entirely yours to give away, of course.)]


1: For example, the GPL allows and encourages commercial distribution of free software; and a large number of open-source contributions — to Linux, GNOME, KDE, Mozilla, etc. — come from programmers being paid out of commercial incentives.

ShreevatsaR
+1 Thank you ShreevatsaR.
hgpc