There is a repository of code that I would like to use to run a website. The code is under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) license, as the title states.

Given that it is under a non-commercial license, as I believe I understand, I cannot make profit from the website. However, I am interested in knowing if I could accept donations from others to negate the cost of running the website.

As stated in this answer, it seems as though it could be possible. However, there is also someone else who answered a different question here that makes me think twice. It seems as though it comes down to what the definition of "commercial advantage or private monetary compensation" is. I think that it would not give me a commercial advantage, but I am not sure if it would qualify as private monetary compensation.

I'll contact a lawyer to get a professional view on it at some point, but I'm doing my best to research it myself first.

  • 1
    As there is no legal bright line on what is prohibited by the NC clause, consider asking the original author of the NC code if they consider a donations option to offset the operating costs to be a violation of the license. Some may, some wont. Commented Jun 5, 2023 at 7:16

2 Answers 2


Version 4 of this license has pulled out the NonCommercial definition into a separate paragraph, which reads as follows:

NonCommercial means not primarily intended for or directed towards commercial advantage or monetary compensation. For purposes of this Public License, the exchange of the Licensed Material for other material subject to Copyright and Similar Rights by digital file-sharing or similar means is NonCommercial provided there is no payment of monetary compensation in connection with the exchange.

If your website will be "primarily intended for or directed towards [...] monetary compensation," then it violates this term. The next sentence clarifies that a barter exchange of one copyrighted work for another is not considered "commercial" in this context unless money changes hands. To my understanding, that sort of exchange is not unheard of in certain artistic communities, but it is not relevant to your question.

What this really comes down to, in your case, is how "primary" your donations would be. If you're running the site for its own sake, and donations are just meant to defray costs, then you might have a stronger legal leg to stand on (compared to e.g. running ads on the site and making a profit from it). If you incorporated a charitable organization or trust, that might also tend to help, but it must be emphasized that this provision contains no bright line carve-out for such legal entities. A trust or charity provides a legal framework for ensuring that donations are spent only on defraying costs and are not taken as profit, but the license doesn't automatically recognize that as "good enough." In fact, the license does not explicitly authorize defraying costs at all, but you could argue that the donations are just a means to the end of running the website (and not the "primary" purpose of the website). It is unclear to me whether that argument would work.

A judge would have to look at the totality of the circumstances to determine whether you are "primarily" running the website for monetary compensation, and it is difficult to predict how the judge would rule. Such a ruling might also depend on the jurisdiction in which the case arises. You should consult a lawyer as your question suggests.

  • Thank you for this thorough answer. This is essentially what I understood from the license, and I'm glad to see I'm starting to gain an understanding of it properly. I'm really intrigued by the barter system. It further cements the idea that CC is not really intended for code. I am only intending on accepting donations to account for server costs. Any excess would be donated to a charitable organization.
    – K. LeBlanc
    Commented Jun 6, 2023 at 17:20

Creative Commons published their interpretation of 'Non-Commercial' in their FAQ and in a wiki page. However, these pages do not clarify your specific question about donations.

There is a long article about NC licenses on the Freedom Defined webpage, explaining all the things they perceive are wrong about the NC licenses.

CC emphasizes the difference between 'use' and 'user'. A commercial user can still use the licensed materials for a non-commercial purpose.

Therefore, the important question is about the nature of your website. Is it commercial (directly or indirectly for your financial gain) or not? Will the donations really just cover the hosting cost and maintenance (partly or fully, on average), or is there a surplus that goes into your private pocket?

Your question says "code that I would like to use to run a website". CC suggests not to use their licenses for software, so there are gaps in what the license language covers.
If this code is not shared with the users of your website (i.e. the code is just in the back end and not part of the HTML of JS code delivered to the visitors), then the restrictions in Section 2.a.1 do not apply to you. You may run the code without restriction (for example under the terms of Article 5.1 of DIRECTIVE 2009/24/EC. But this depends on your jurisdiction, and you may want to consult a lawyer to understand what it means to you.

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.