Suppose I develop a useful library and decide to publish it as open source. Some time later I have a business need to do something that wouldn't comply with the open source licence. Am I allowed to do that?

How should I publish the software in a way that I keep ownership and don't block myself from using the library in the future in any way?

Keep in mind that at least in theory, other developers may decide to contribute to my open-source project. Can I specify in a licence that I as the original developer get ownership of their contributions as well? Don't get me wrong here, I'm not trying to be evil and get ownership of other's work - I just want to keep ownership of mine, and if someone posts an important bugfix I could be rendered unable to use the original code unless I use his work as well.

  • 6
    Releasing under one license doesn't preclude you from releasing under others also -- after all, you still own the code. Source code is dual-licensed (or tri-, or more) all the time. Sep 19, 2010 at 2:09

3 Answers 3


You always keep ownership under open-source licenses. The work you created is your property, and you can do whatever you want to with it, (within legal limits, of course,) including allowing other people to use it under the terms of an open-source license. If you want to use it for a proprietary project, you're welcome to do so, unless you have completely turned over the rights to someone else by contract. But this is not what open-source licenses do. They're about sharing usefulness, not about giving up ownership.

Things get a bit sticker once other people start contributing. It's their work, then, not yours, and you need to get their permission. One thing you can do is publish your library under a dual license. That's what Sam Lantinga, the primary creator and maintainer of SDL, does. Because Apple doesn't like dynamic link libraries for iOS, and complying with the LGPL in a statically linked app is more trouble than it's worth, he publishes SDL under both the LGPL and a commercial license for static iPhone apps. When anyone submits a patch, he explicitly asks them for permission to deploy their patch in the library under both licenses, and if they don't like that, he doesn't add it to the codebase.

EDIT: My example is no longer accurate. A while back Sam changed the model (not sure why; maybe he just got tired of the administration hassles) and now licenses SDL under a highly permissive zlib-style license. But he used to do it this way.

  • 1
    +1 especially for showing how to handle contributions from other authors. Sep 24, 2010 at 11:28

I am not a lawyer and this is not legal advice. If you need legal assurance, hire an attorney.

You absolutely can dual-license your software - Trolltech did that for many years with Qt, and Linden Lab did it with the SecondLife client.

You can use any license you like. Some licenses are compatible with closed commercial environments, such as the Mozilla MPL, MIT and BSD licenses, and (I believe) Sun's CDDL and the Apache licenses.

However, if you need the flexibility to release your software both as an open source project and as a closed-source product, you are absolutely allowed to do that as the original author. The only problem is the issue of user contributions. You can't incorporate the contributions of others into your commercial version of the software unless they legally release the Copyright to you. GNU does this for the sole reason that they will update their licenses in the future.

Do note that users and especially contributors will probably not like this, so it will affect the community around your project, probably adversely.

Again, consult an attorney for details.

  • MIT, aka the 'do whatever the hell you want' license. Feb 19, 2014 at 1:47

I am not a lawyer too, but...

Apart from restrictive (that will force you to Open Source each project that uses them) licenses like GPL, there are also non-restrictive (meaning that you can use such piece of software in a commercial project) like Lesser GPL or Apache License (2.0?). So maybe you can simply release your software under non-restrictive terms.

  • 2
    GPL does not change ownership of code. If I publish code on GPL it applies to other people who uses the code - I have any permission I like and I can do with it anything I want (however as law does not works backward I cannot limit the use of people who used the software on GPL). Sep 19, 2010 at 14:22
  • 2
    What I meant by saying restrictive, is GPL forces users of your library to release their software under GPL-compatible license, whereas licenses like L-GPL, Apache, ... (BSD?) doesn't. Now, I am not sure that if you GPL-ed your code and someone commits changes to it, you can then just simply release it commercially as if nothing has happen. I think you need to get rid of additions first... But if the library/framework is L-GPL licensed, you can use it in commercial applications just like anyone else, that is for sure. I hope it make sense. Sep 20, 2010 at 6:59
  • This is exactly what I do when I write a library. It doesn't make a lot of sense to release a commercial library, usually it is end-user application which gets to be released in that way, and if it is a non-restrictive license I can use the library in my project. And it doesn't even matter if I wrote it or someone else. Nov 16, 2011 at 13:36
  • @Goran, you can use the library in your own project no matter what license it's under. It's your library, and your project: the license applies to other people, not to you.
    – TRiG
    Mar 21, 2013 at 15:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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