Skip to main content

Add a License

Published: Sep 8th, 2020

This is part of Joyful Rails, a list of recommendations to make developing your Rails app more productive and joyful.

In this article, we are talking about adding a license.


When you want to allow other people to use your code, use a license file to make it clear that they can.


You (or your employer) own the copyright of the code you write. Using your code involves making and distributing copies of the code and derivatives thereof. In order for other people to do that legally, they need permission from the copyright owner.

A license file tells them what permissions you are granting them and under what conditions.


Consider using the Hippocratic License.

Put a copy of the license in a file called LICENSE in the root folder of your git repository.


There are dozens of widely used open-source licenses with various terms for things like credit, source-code availability, or even, in the case of the Hippocratic License, a commitment to not violate human rights.

There are even licenses that are actually dedications to the public domain, renouncing the author’s copyright entirely.

The license you choose should reflect your values and goals. No matter what those are, there is probably a license that supports them.

Please do not write your own open-source license. Software licenses are legal documents that require extensive expertise to read and write. Even if you do manage to create something that does what you intend, each of your users will have to invest extra effort to be certain of what it does and all its repercussions.