Edit: This was originally posted in law.stackexchange and was moved here with no input from me. I'm well aware that most Open Source advocates argue against any license that restricts others from profiting from any open source work. I think my best option is to break my question down in to several questions and reask them over at law.

Original Post: I am working on a project and I have the source code on github. I'd like to add a license to it, but I'm not sure exactly what I need. I have the following circumstances:

  • I'd like to eventually be able to sell or otherwise benefit financially from the project.
  • I'd like to prevent anyone else from doing so.
  • However, I'd like to make the source code freely available to others for personal use, including giving them the right to modify it and pass it on to others.
  • I'd like to keep my right to be identified as the original author.
  • Part of the code includes work that was originally published under the MIT license by someone else, but it has been reworked extensively by myself. I don't want to make any claim over this part of the code.

Is there a widely available license that will let me do all of the above?

If not, with regard to the final point, I assume I have the option of hosting the modified code in a separate repository, so that the main repository would only contain my original work. What license could I use then?

EDIT: If there's a tool that let's me create a legally valid license with the above criteria, that would be a good answer too.

  • What you mean "widely available license"? You can always create your own license that suits your needs. It does not need to be already used by anyone to be valid.
    – Greendrake
    Feb 21, 2019 at 2:19
  • Github has an "Add a license" feature with a selection of "widely available" licenses, such as MIT and GPL. I guess by "widely available" I mean prexisting and known to be legally valid. If there's a tool that let's me create my own legally valid licenses, that would be a good answer too.
    – Joel Roberts
    Feb 21, 2019 at 2:26
  • 1
    Such a tool is called "lawyer". You'd need to hire one.
    – Greendrake
    Feb 21, 2019 at 2:30
  • Tools like this do exist or have existed, such as choosealicense.com or binpress.com/license-generator (doesn't currently work) If you're confident that either tools like that do not create trustworthy licenses, or my criteria are too specific for any tool so my only option is to pay a lawyer, please feel free to add that as an answer.
    – Joel Roberts
    Feb 21, 2019 at 2:45
  • 1
    "I'm well aware that most Open Source advocates argue against any license that restricts others from profiting from any open source work" actually, we advocates don't mind those; if you write software, you can choose what licence to release it under. What we do oppose is licences that restrict user freedom and still want to be called FLOSS.
    – MadHatter
    Mar 1, 2019 at 6:56

2 Answers 2


There are various licenses which might achieve what you want. The very widely used Creative Commons CC-BY-NC-SA would seem to do everything you desire, although it is not the only one that would.

You can read more about Creative Commons licenses in this Wikipedia article.

Note that once a work is released under a creative commons license, people may continue to use it under the terms of the license even if the author stops releasing it and attempts to revoke the license. (It may be possible for a US author to terminate a license after 35 years, but this is not certain.)

While you can surely create your own license, you run the risk of creating unintended results or inconsistent requirements, and may not achieve your desires. I would urge using an existing and tested license if it will serve your purposes. You may still want to consult a lawyer, and this is not legal advice.


No open source license would fit your requirements.

The Open Source Definition lists things that open source licenses do/not do. OSD #6 is “No Discriminiation Against Fields of Endeavour”, which means that an open source license must not prevent commercial use. You want to allow only personal use; this is not compatible.

You are not the only one who would like such a license, so there are various approaches outside of Open Source:

  • The Creative Commons licenses include NonCommercial variants. However, these are intended for general creative works but are ill suited for software. Despite this they are sometimes used.
  • Back when Microsoft thought that Linux was cancer, they developed a suite of Shared Source licenses, including the “look but don't touch” Microsoft Reference Source License.
  • Recently a number of previously Open Source companies want to deny their software to cloud providers. For this purpose Redis has developed the Commons Clause and later the Redis Source Available License Agreement.
  • A summary of various approaches is also given in the Source Available Wikipedia article.

Any such approach is not Open Source, and potential users might therefore be hesitant to use your software, especially if your software uses a completely custom license. You should also not accept outside contributions to your software until you are sure how this affects copyright/licensing status. You may not be able to use some libraries. You are perfectly free to create proprietary software, but you do give up some of the open source network effects.

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.