Disclaimer: The following is not legal advice and shouldn’t be treated or relied upon as such. Code licenses are binding legal documents that should be treated seriously. You are exclusively responsible for compliance with the terms of the license under which you use code, and it is always best and advisable to consult a lawyer before making licensing related decisions or use.
Offering another license is a great way to start getting paid for your open source project.
Often called “Dual licensing”, it means you offer your code in two separate repositories – both have the exact same code, but a different license. Usually, the public repository will hold a copyleft license for free use, and the private repository will hold a more permissive license for paying users.
Different open source licenses provide different limitations on how users can use your code. Those limitations can make it difficult to use your code when creating commercial software. With dual licensing, you offer a free version of your code with those limitations, and a paid version without them. First, let’s learn a bit about open source licenses.
Open source licenses are usually divided into two main categories:
Permissive licenses (such as MIT, BSD or Apache 2.0) – These licenses impose “soft” requirements, which are easy for commercial kind of users to adhere (almost “no strings attached”), thus making them an attractive alternative when looking for code to use in commercial applications.Learn more about permissive licenses
Restrictive (or ‘Copyleft’) licenses (Such as the GPL licenses) – These licenses may under certain scenarios result in “harsh” consequences for commercial kind of users, making them sometimes problematic for companies looking for code to use in commercial applications. For example, in some cases, using GPL licensed code in a project, may result in subjecting the entire project’s code to the GPL open source license as well. For companies developing proprietary software, this can often not be possible.Learn more about copyleft licenses
To use dual licensing, you must comply with 2 main requirements. Both requirements MUST be met before proceeding:
1. You must have the legal rights to re-license the entire code
You must have the right to re-license the entire code you wish to re-license, including any code contributions it may contain.
If you started your code from scratch, applied the license to your own code, and did not accept any code contributions, you’re supposed to be the sole author and the copyright holder (putting aside issues like rights of your employer etc., which you should carefully check and comply with) meaning that you should have the rights to re-license.
If your code contains code contributions, you might need to obtain the consent of those contributors before you change the license which applies to the code they have donated. We highly recommend you to use contributor license agreement to receive contributions, which will, in advance, anchor your right to change the license applying to the contribution. Otherwise, you can reach the contributors and obtain their consent (or remove contributions that consents were not obtained in their regard).
2. Your original code must be licensed under a permissive license (such as MIT or BSD)
If your code is currently not licensed under a permissive license, please contact support before proceeding.
You will need to keep two repositories on your Github account:
You can offer services for a one-time payment, or as an ongoing subscription.
Assuming you have the legal right to do so (see above for general explanation), change the public repository’s license to the copyleft license you chose (Such as GPL).
Then, edit the LICENSE text file in the repository root folder to the GPL version of your choice.
First, you’ll need to add your public repository, which is the foundation on which you will create your paid items.
Click “Add repository” and follow the instructions. Your repository has to be public, and you’ll need to install our Read-only Github app on you repository for verification purposes.
Now, let’s create your paid “license” item and connect it to your private repository. In the repository editor, click “Add item“, and select the License item type. You’ll need to install our Github app on your private repository, so we can clone your code to our servers. Users who purchase this item, will get a unique read-only token to access your private repository with git, npm or pip.
Choose your item’s price and billing model:
We suggest offering your dual licensed code with a reasonable annual subscription.
Choose your item’s price and billing model:
The best place to start promoting your paid items, is on your readme file.
Use our badge to place a link to your xs:code repository page to notify your users about the items you are offering.
You can also use social media, blogs and developer community websites to promote your project.
Click on the chat icon or email us at: [email protected]
Can’t decide what to offer? Need help with pricing? Get one-on-one guidance.
Our support team is here to help with any technical issue via Chat or email.
There’s a lot you can do to get more paying users. Get our best practices and tips.