How to license research software
This is a guide to how to license research software. It collects together the advice we give to researchers on how to license research software. It is not exhaustive. Please get in touch if you think we are missing something or there is something you think we should change.
Why does my software need a license?
Software is automatically copyrighted the moment it is created. This means that any copyrightable work that you create is always completely under your control as far as copyright allows. There are good reasons for this but the result is that if you want to share some code you've written with someone then they can't do much useful with it (such as copy it themselves or build upon it) unless you give them an explicit license to relax the conditions imposed by copyright.
Who decides what license can be used for my software?
Only the copyright holder has the right to choose the software license. This choice may be constrained by the terms of funding the work needed to write the software. For example, it is common for grants to contain a promise that an open source license is used, or that a specific licence is used. This promise forms part of the contract of work related to the grant, and so the copyright holder would be required to choose that license for the work.
Who owns the copyright of my software?
Just because you wrote the software does not mean that you are the copyright holder. The copyright of any software written by a member of staff of the University as part of their work, or any software written during work hours, or any software written using any University equipment is automatically owned by the University (this is part of general terms and conditions of employment). This applies unless there were specific terms attached to the source of funding of the work. Students (including PhD students) will own the copyright of software they produce, unless there were specific terms attached to the source of funding, or if the software is clearly derived from software originally developed or being developed by a member of staff or already under a University copyright (it would be classed as a derived work and the copyright would depend on the terms by which you were allowed to derive from the original work, e.g. you may be required to agree to transfer any copyright before undertaking the work). Note that all of the above applies regardless of whether or not you wrote the software during "work hours" or in your own time.
In general, the University is very relaxed with respect to copyright, especially if the software is written as part of a UKRI-funded grant and the software will be released under an open source license (and especially if there was a promise in the grant to open source the software). We recommend that you talk to your line manager and to Research and Enterprise Development (RED) if you have any concerns or questions, or if you want to release your software under a commercial license. If you want to use an Open Source license than RED have produced an excellent Open Source Licensing FAQ.
What does open source mean?
Since the 1980's there has been a movement of people who think that all software should be freely shareable and usable by anyone, for any purpose. It is this movement that gave rise to projects such as Linux, Python, Firefox, Wikipedia and VLC. These types of software are referred to as Free Software or Open Source Software. Software is considered Free Software if the software's users have the following four freedoms:
- The freedom to run the program as you wish, for any purpose (freedom 0).
- The freedom to study how the program works, and change it so it does your computing as you wish (freedom 1). Access to the source code is a precondition for this.
- The freedom to redistribute copies so you can help others (freedom 2).
- The freedom to distribute copies of your modified versions to others (freedom 3). By doing this you can give the whole community a chance to benefit from your changes. Access to the source code is a precondition for this.
Free Software works within copyright law by providing licences which allow use of the software for any purpose while protecting the author as much as possible. All of the projects mentioned above have a Free Software licence which is what guarantees that they will always remain free, both in terms of cost and what you are allowed to do with them. This contrasts with "closed-source" software such as Microsoft Word which you cannot see the source code for and are not free to share with others and Google Chrome which, while cost-free, is restricted in what you can use it for.
Should I open source my software?
This is the choice of the copyright holder. Increasingly, the research councils are taking the view that research funded by public money should be open and freely available to the public. As such, it is recommended that software outputs from research are open sourced, unless there are compelling reasons otherwise. This is described in the UKRI Open Access Policy, in which software is classified as underlying research materials that form the "research data" that should be made openly available. In addition, the choice of license should be identified in the research grant, so that this can assessed during peer review.
In our experience, it is much easier to open source software than to pursue a closed-source (commercial) model. Open sourcing means that you don't have to worry so much about copyright. It also makes it easier for others to use and build upon your work. Research software is so powerful because there is a large international community who share and build upon each other's work. If your research benefits from that community, then it is right that you contribute back.
However, there are some cases where open sourcing is not the right choice. Sometimes you need to use a commercial license to protect, e.g. trade secrets, or so that you can generate an income stream by selling the software. Please get in touch with us and/or RED if you want to discuss.
How do I choose an open source license?
Assuming you have permission from the copyright holder (or grant conditions), there are lots of ways to license your code to make it open source, each of which have their own pros and cons. The technicalities of exactly which licence works for you are tricky but to simplify things, you can use a website like choosealicense.com.
The choice generally comes down to how permissive you want to be. Either you put almost no constraints on what the user of your code can do with it (e.g. the MIT licence) or you can require that for example, any changes they make to your code must be made public and open source or even that any software which uses your code must be made available wholly as open source too (e.g. the GNU GPL).
Most licences only require that there is a single file in your source code directory called something like
LICENSE.txt which contains the text of the licence. Some licences advise that you should also put a message at the top of every file but choosealicense.com will inform you of the appropriate approach.
How do I make my code free and open?
Assuming you have permission from the copyright holder (or grant conditions), then there are three steps to making your code open:
- Choose a licence, agreed by everyone on the project
- Put the licence text in a file alongside your code
- Make your code publicly available, e.g. by uploading somewhere such as GitHub or GitLab.