Skip to content
GitShowcase Forum

Which license should I pick for my first open source project?

Staff answerWritten by Nils Haugen · Open Source Maintainers0 replies

Short answer

For most first projects, pick MIT if you want the shortest permissive license, Apache 2.0 if you also want an explicit patent grant, and GPLv3 if you want improvements shared back. If your project joins an existing ecosystem, copy that ecosystem's license. Do not publish with no license at all.

Written by Nils Haugen · APIs and tooling editor: LLM, MCP, payments and portfolios ·
CiteGitShowcase Forum, "Which license should I pick for my first open source project?", https://gitshowcase.com/forum/discuss/which-license-should-i-pick-for-my-first-open-source-project/, accessed 2026-11-18.
  1. APIs and tooling editor: LLM, MCP, payments and portfolios ·

    This is general information about how common licenses work, not legal advice. For a company project, a dual licensing plan or anything with money at stake, ask a lawyer.

    Start with the default: no license means no permission

    Many first time maintainers skip the license because they "just want people to use it." That backfires. According to Choose a License on no license, creative work, code included, is under exclusive copyright by default, and unless you include a license that says otherwise, nobody else can copy, distribute or modify it without risk. Public hosting terms let people view and fork your repository, but that is not enough for the experimenting, modifying and sharing that people usually expect from a public repo.

    So a license file is what turns "visible code" into "code others can use". It is also why companies and careful developers will not touch an unlicensed dependency.

    The decision rule

    Ask two questions:

    1. Do you mind if someone takes your code into a closed source product? If you do not mind, pick a permissive license. If you want improvements to come back, pick a copyleft license (one that requires derived work to stay open under the same terms).
    2. Does your project depend on, or plug into, a community with a strong default? If yes, follow it. The Choose a License front page puts this first: use the license preferred by the community you are contributing to or depending on, and your project will fit right in.

    The three common options

    License In one line Conditions Good fit
    MIT Short, permissive, lets people do almost anything, including closed source versions Keep the license and copyright notice Libraries, CLIs, templates, portfolio projects
    Apache 2.0 Permissive, with an express patent grant from contributors Keep notices, state changes Projects where patents or company adoption matter
    GPLv3 Strong copyleft: people may use and change it, but distributed versions must share source Disclose source, same license, keep notices, state changes Tools where you want improvements shared back

    The permissions and conditions above come from the Apache 2.0 and GPLv3 pages on Choose a License, and the MIT summary from the home page. The Apache and GPL pages both list commercial use as permitted and list liability and warranty as limitations, meaning you are not on the hook for how others use the code. Apache 2.0 additionally says it does not grant trademark use, so your project name stays yours.

    What each one means in practice

    • MIT. Someone can bundle your library inside a paid closed source app and owe you only the copyright notice. That is the trade for maximum adoption.
    • Apache 2.0. Same freedom, plus an explicit patent license from each contributor. The text also says that if someone sues over patents claiming the work infringes, their patent licenses under it end. It requires modified files to carry notices that they were changed.
    • GPLv3. If someone distributes a modified version, the whole work must stay under GPL with source available. That discourages closed forks but can also stop some companies from using your code at all. If you want a library that proprietary apps can link to, the GPL text itself points to the GNU Lesser General Public License for that case.

    Step by step: add the license correctly

    1. Create a file named LICENSE in the repository root. Choose a License says to copy the license text there (GPL projects traditionally use COPYING).
    2. Replace placeholders like the year and your name, where the license has them.
    3. Add the SPDX identifier to your package metadata so registries display it. For example in package.json:
    {
      "name": "my-first-project",
      "version": "0.1.0",
      "license": "MIT"
    }
    

    Use Apache-2.0 for Apache. For GPL, the site suggests GPL-3.0-or-later, or GPL-3.0-only to disallow future versions.

    1. Mention the license in your README, ideally with a one line section at the bottom. See how to write a README people will try for where it fits.

    Mistakes to avoid

    • Mixing license text. Paste one full license, not a summary.
    • Changing the license later without asking contributors. Once the work has other contributors, each is a copyright holder, as the Choose a License no license page points out, so relicensing gets hard. Decide before you accept outside code.
    • Picking a license for a dependency's sake only. Check what your dependencies require before you decide. A GPL dependency can shape what you are allowed to ship.
    • Using a made up license. Custom terms scare off adopters and are easy to get wrong.

    If you genuinely want no restrictions at all, the site points to a public domain dedication instead of no license, since opting out of licenses does not opt you out of copyright.

    0
    ReplyLink

Plain text or simple Markdown. Links are nofollow. Your email is never shown.

GitShowcase Forum. Questions and answers on shipping developer projects: dev tools, APIs, infrastructure and portfolios.