# Shutting Down a Startup: Open Source the Code or Sell It?

> Shutting down a startup and deciding what to do with the code? What open-sourcing gives up, who must agree to a sale, and what a private repo needs first.

Canonical: https://origindatapartners.com/guides/startup-shutdown-open-source-or-sell-code
By: Origin Data Partners
Status: Published
Published: 2026-11-15
Updated: 2026-11-15
Sources checked: 2026-11-15

## Quick answer

Decide before you publish anything, because open-sourcing cannot be undone. A permissive licence gives everyone, for free and for good, most of what a buyer would pay for. While the repository is private, the company can still sell the product, license the code for AI training on non-exclusive terms, or both. The code belongs to the company and its creditors come first, so the board decides, not the founders alone.

## Key points

- Open-source licences are written to be permanent. You cannot take the grant back later.
- A private repository can be licensed for training without being sold. The two are not the same deal.
- Board approval is the minimum. A sale of substantially all assets may need a stockholder vote and a lender's release.
- Export the repository, issues and reviews before any account is closed.

## Should a startup that is shutting down open source its code or sell it?

Check for a buyer or licensee first, then open source what is left if you still want to. The order matters because only one of the two choices can be reversed. A private repository can become public later. A public one cannot become private again in any way that counts.

The table compares the choices. This page is general information, not legal advice. The company's charter, financing documents and loan agreements decide who must approve.

| Choice | What the company gets | What it gives up |
| --- | --- | --- |
| Open source under a permissive licence | Goodwill, a public record of the work, continued use by customers | Exclusivity and trade secrecy. Anyone may use the code, including for training |
| Sell the product or codebase to one buyer | A price, and possibly a home for customers | The code. The buyer usually wants exclusivity and warranties |
| License the private repository for AI training | A licence payment. The company keeps ownership | Little, if non-exclusive. A later buyer must accept the licence |
| Sell first, with a training licence carved out or done beforehand | Both payments, if the buyer agrees | Negotiating effort and time |
| Do nothing | Nothing | The repository is deleted when accounts lapse |


## Does open-sourcing end the chance to license the code?

Mostly, yes. Once code is public under an open-source licence, anyone can already do what a paid licence would have allowed, so few will pay. You still own the copyright, but there is little left to sell.

The grant is built to last. Under Apache 2.0 each contributor gives "a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license" ([Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0)). The MIT licence grants permission "free of charge, to any person obtaining a copy", including the rights to "use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies" ([MIT License](https://opensource.org/license/mit)). An open-source licence also cannot carve out a use: "the license must not restrict anyone from making use of the program in a specific field of endeavor" ([Open Source Definition](https://opensource.org/osd)). So there is no approved licence that is open to everyone except model training.

Publication also ends trade secrecy. A trade secret has value "from not being generally known" and requires that the owner "has taken reasonable measures to keep such information secret" ([18 U.S.C. 1839](https://www.govinfo.gov/content/pkg/USCODE-2024-title18/html/USCODE-2024-title18-partI-chap90-sec1839.htm)). Private code is scarce to an AI developer for the same reason: public repositories are already widely available.


## Who has to agree: the board, investors or lenders?

The board at least. Stockholders must approve if the deal is a sale of all or substantially all assets, a lender must release its lien if it has one, and preferred investors may hold a contractual veto. Founders cannot decide alone, even if they wrote every line.

Delaware is the common example. A corporation may sell "all or substantially all of its property and assets" when authorised "by a resolution adopted by the holders of a majority of the outstanding stock of the corporation entitled to vote thereon" ([Delaware General Corporation Law, section 271](https://delcode.delaware.gov/title8/c001/sc10/index.html)). Dissolution itself needs a board resolution and a stockholder vote under section 275. Other states and other entity types have their own rules.

A lender with a security interest in the company's intellectual property has to be dealt with: "a security interest or agricultural lien continues in collateral notwithstanding sale, lease, license, exchange, or other disposition thereof unless the secured party authorized the disposition free of the security interest" ([UCC 9-315](https://www.law.cornell.edu/ucc/9/9-315)). Giving code away for nothing when creditors are unpaid is a decision to take with counsel. If an assignee, liquidator or trustee has been appointed, the decision is theirs.


## Who buys a failed startup's code?

Three kinds of party, for three different reasons. A competitor or customer buys the product to run it. An acquirer hiring the team takes the code along. An AI developer licenses the repository and its history to train or test coding models, and does not need the product to work as a business.

The third is the newest and the least known to founders. It values the history of real engineering work more than the product. The [guide to selling source code for AI training](https://origindatapartners.com/guides/sell-source-code-ai-training) covers that route, and [acquihire versus selling startup data](https://origindatapartners.com/guides/acquihire-vs-selling-startup-data) compares it with a team sale.


## What is the difference between selling the product and licensing the repository for training?

A product sale transfers ownership to one buyer who wants to operate or absorb the software. A training licence leaves ownership with the company and lets a developer use the code and its history as data, normally without exclusivity.

That makes the two compatible if you sequence them. A non-exclusive training licence granted before a product sale survives it only if the buyer accepts it, so disclose it. A product buyer who demands exclusivity rules a later licence out. See the [data licensing agreement guide](https://origindatapartners.com/guides/data-licensing-agreement) for the clauses involved.


## What does a private repository need to be licensable?

Clear ownership, clean contents and its history intact. A licensee will ask whether the company owns every line, what third-party code is inside, and whether secrets or personal data are in the commits.

Ownership comes from employment and from paper. For employees, a work made for hire belongs to "the employer or other person for whom the work was prepared" ([17 U.S.C. 201](https://www.govinfo.gov/content/pkg/USCODE-2024-title17/html/USCODE-2024-title17-chap2-sec201.htm)). For contractors and early founders who were never employees, an assignment is needed, and "a transfer of copyright ownership, other than by operation of law, is not valid unless an instrument of conveyance, or a note or memorandum of the transfer, is in writing and signed" ([17 U.S.C. 204](https://www.govinfo.gov/content/pkg/USCODE-2024-title17/html/USCODE-2024-title17-chap2-sec204.htm)). Find those documents now, while people still answer email.

A repository with no licence file is not free for others to use: "without a license, the default copyright laws apply, meaning that you retain all rights to your source code" ([GitHub Docs](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/licensing-a-repository)). That is the position you want to keep until you decide.

- Signed invention assignment or contractor agreements for everyone who committed code.
- A list of open-source dependencies and their licences, and any code copied in from elsewhere.
- A scan of the full history for credentials, keys and customer data.
- Commit history, branches, issues, pull requests, reviews and CI logs, not just the latest snapshot.
- Customer-specific code and customer names identified, with the contracts that cover them.


## Can founders keep the code?

Not by default. The code is a company asset. A founder who wants it has to get it from the company through a sale or assignment that the board approves, at a price that is fair to creditors and stockholders.

Copying the repository to a personal account before dissolution, without that paper, leaves the founder holding code they do not own. It also clouds title for any later buyer or licensee.


## Can the code be sold or licensed after dissolution?

Often yes, for a limited time, if the code still exists. The practical risk is deletion, not the law: accounts lapse, and the repository goes with them.

In Delaware a dissolved corporation continues "for the term of 3 years from such expiration or dissolution" for purposes that include "to dispose of and convey their property" ([Delaware General Corporation Law, section 278](https://delcode.delaware.gov/title8/c001/sc10/index.html)). Someone must still have authority to sign, and proceeds go through the same order of creditors and stockholders.

The code host is less forgiving. "Deleting your organization account permanently removes all repositories, forks of private repositories, wikis, issues, pull requests, and project or organization pages. This action is irreversible" ([GitHub Docs](https://docs.github.com/en/organizations/managing-organization-settings/deleting-an-organization-account)). Archiving is the safer state: it makes a repository "read-only for all users" ([GitHub Docs](https://docs.github.com/en/repositories/archiving-a-github-repository/archiving-repositories)). See [selling company data after closing](https://origindatapartners.com/guides/sell-company-data-after-closing).


## Checklist: the order of steps before dissolution

Work down the list. Nothing here is public or irreversible until step 8.

| Step | What to do | Why now |
| --- | --- | --- |
| 1 | Export the repositories with full history, issues, pull requests and CI logs to storage the company controls | Hosting accounts end with the subscription |
| 2 | Collect assignment agreements for every contributor | People become hard to reach |
| 3 | List third-party code, licences and customer-specific work | A buyer or licensee asks on day one |
| 4 | Scan history for secrets and personal data. Rotate live credentials | Needed for any route, including open source |
| 5 | Read the loan documents and investor rights for consents | A missing consent can undo a deal |
| 6 | Ask whether a product buyer or a training licensee exists | Only possible while the code is private |
| 7 | Have the board approve the route, with stockholder and lender consents if required | The decision is the company's |
| 8 | Only then publish under an open-source licence, if that is still the choice | It cannot be reversed |

If you do make the repository public, note what the host does with forks: "public forks are not made private" if you change your mind later ([GitHub Docs](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/managing-repository-settings/setting-repository-visibility)). The wider wind-down is covered in [how to shut down a startup](https://origindatapartners.com/guides/how-to-shut-down-a-startup).


## Common mistakes at shutdown

Most are made in the last two weeks, in a hurry.

- Publishing the code as a farewell gesture before asking whether anyone would pay for it.
- Founders deciding without a board resolution.
- Forgetting the lender's lien on intellectual property.
- Letting the code host and CI accounts lapse before exporting.
- Keeping only the final snapshot and losing the history, issues and reviews.
- Open-sourcing code that contains customer work, licensed components or live credentials.
- A founder taking a personal copy with no assignment from the company.
- Granting a buyer exclusivity without mentioning a training licence already signed.


## A private codebase as a data asset

Years of commits, reviews and bug fixes on a product that real customers used are a record of how software is built and repaired. AI developers license that record because it is private. A company that is closing can often license its code and sell other intellectual property as well. See [selling a closed company's intellectual property](https://origindatapartners.com/guides/sell-intellectual-property-closed-company).

Origin works with buyers and helps a company describe its repositories, find out what they could be worth and decide on a route before anything is made public. Nothing is exported at the start. Origin Data Partners is an independent data partner that helps companies get their data bought. A buyer may pay Origin when a deal closes.

Does your company hold records like these? [See what your data is worth](https://origindatapartners.com/check-fit).


## Questions and answers

### Our startup is shutting down. Should we open source the code?

Check first whether a buyer or a training licensee exists, because open-sourcing is permanent and gives away what they would pay for. If nobody wants the code, open-sourcing is a reasonable end, once the board approves and creditors are not harmed.

### What should a startup do with its code when it shuts down?

Export the full repository history, collect contributor assignments, scan for secrets, check lender and investor consents, and ask whether a product buyer or AI training licensee exists. Decide on open source only after that.

### Can you sell a failed startup's codebase?

Yes. Competitors and customers buy products, acquirers take code with a team, and AI developers license private repositories with their history for training. The company must own the code and the board must approve.

### Can you sell an abandoned software project or unused source code?

If the company owns it and it is still private, yes. Unused code has little value as a product but can have value as training data when it has real history. Published open-source code has little left to sell.

### Can you sell old source code after the company has dissolved?

Often, for a limited period. Delaware continues a dissolved corporation for three years to dispose of property. The code must still exist, someone must have authority to sign, and proceeds follow the creditor order.

### Do investors have to approve selling or open-sourcing the code?

The board must. A sale of substantially all assets needs a stockholder vote in Delaware, preferred investors may hold a contractual veto, and a secured lender must release its lien. Read the financing documents.

## Sources

- [Open Source Initiative: The Open Source Definition](https://opensource.org/osd)
- [Apache Software Foundation: Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0)
- [Open Source Initiative: The MIT License](https://opensource.org/license/mit)
- [GitHub Docs: Licensing a repository](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/licensing-a-repository)
- [GitHub Docs: Setting repository visibility](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/managing-repository-settings/setting-repository-visibility)
- [GitHub Docs: Deleting an organization account](https://docs.github.com/en/organizations/managing-organization-settings/deleting-an-organization-account)
- [GitHub Docs: Archiving repositories](https://docs.github.com/en/repositories/archiving-a-github-repository/archiving-repositories)
- [Delaware General Corporation Law, Subchapter X: sale of assets, dissolution and winding up (sections 271, 275, 278)](https://delcode.delaware.gov/title8/c001/sc10/index.html)
- [UCC 9-315: secured party's rights on disposition of collateral and in proceeds](https://www.law.cornell.edu/ucc/9/9-315)
- [17 U.S.C. 201: ownership of copyright](https://www.govinfo.gov/content/pkg/USCODE-2024-title17/html/USCODE-2024-title17-chap2-sec201.htm)
- [17 U.S.C. 204: execution of transfers of copyright ownership](https://www.govinfo.gov/content/pkg/USCODE-2024-title17/html/USCODE-2024-title17-chap2-sec204.htm)
- [18 U.S.C. 1839: definitions (trade secret)](https://www.govinfo.gov/content/pkg/USCODE-2024-title18/html/USCODE-2024-title18-partI-chap90-sec1839.htm)

## Related reading

- [Can a company sell its source code to AI companies for training?](https://origindatapartners.com/guides/sell-source-code-ai-training)
- [How to shut down a startup: a founder's checklist](https://origindatapartners.com/guides/how-to-shut-down-a-startup)
- [Acquihire meaning: how deals work and what's left to sell](https://origindatapartners.com/guides/acquihire-vs-selling-startup-data)
- [Sell intellectual property: patents, trademarks and domains](https://origindatapartners.com/guides/sell-intellectual-property-closed-company)
- [Closing a software business: what could have value beyond the code?](https://origindatapartners.com/guides/sell-company-data-after-closing)
- [Cancel Google Workspace or delete Slack? Export data first](https://origindatapartners.com/guides/export-company-records-before-closing)
- [Data Licensing as Non-dilutive Funding for Startups](https://origindatapartners.com/guides/non-dilutive-funding-data-licensing)
