# Licensing FAQs

Current CockroachDB code is primarily licensed in two ways:

- Business Source License (BSL)
- Cockroach Community License (CCL)

CockroachDB core is free to use. Most core features are licensed under the BSL, but some core features are subject to the CCL or third-party licenses.

Non-CCL core features from version 19.1 and earlier are licensed under Apache 2.0; however, some features remain under third-party licenses. Beginning in version 19.2, these non-CCL features are licensed under the BSL for three years before converting to the Apache 2.0 license.

CockroachDB enterprise features require a paid license from Cockroach and are licensed under the Cockroach Community License.

Note:

You can find any feature's license by checking the code's file header in the CockroachDB repository.

## Types of licenses

Type | Description
--- | ---
Apache 2.0 License | Core features under the Apache License are free to use and fully open-source. BSL features convert to this license three years after their release. For license conversion dates, see the table below.
Business Source License | BSL features are free to use and the source code is available, but users may not use CockroachDB as a service without an agreement with Cockroach Labs. The BSL is not certified as an open-source license, but most of the Open Source Initiative (OSI) criteria are met.
Cockroach Community License | CCL (Free) features are free to use. The source code is available to view and modify, but it cannot be reused without an agreement with Cockroach Labs. CCL (Paid) features require an enterprise license key to access. The source code is available to view and modify, but it cannot be used without an agreement with Cockroach Labs.

For additional custom licensing options, contact us.

For each BSL release all associated alpha, beta, major, and minor (point) releases will become Apache 2.0 on the same day three years after the major release date. Once a release is published under the BSL, the license cannot be changed to prevent code from becoming open-source at the specified change date. The following table lists the current license for non-CCL features for each published release:

### License conversion timeline

CockroachDB version | License | Converts to Apache 2.0
--- | --- | ---
20.2 | Business Source License | Nov 10, 2023
20.1 | Business Source License | May 12, 2023
19.2 | Business Source License | Oct 01, 2022
19.1 | Apache 2.0 | -
2.1 | Apache 2.0 | -
2.0 | Apache 2.0 | -

## Feature licensing

The table below shows how certain core and enterprise features are licensed:

Feature | BSL | CCL (free) | CCL (paid)
--- | --- | --- | ---
Import |  | ✓ |
Export | ✓ |  |
Core backup and restore |  | ✓ |
Enterprise backup and restore |  |  | ✓
Incremental backups |  |  | ✓
Core changefeed |  | ✓ |
Enterprise changefeed |  |  | ✓
Table-level zone configuration | ✓ |  |
Geo-partitioning |  |  | ✓
Follower reads |  |  | ✓
Node map |  |  | ✓
Locality-aware index selection |  |  | ✓
Encryption at rest |  |  | ✓
Role-based access management* | ✓ |  |
Password and certificate authentication | ✓ |  |
GSSAPI with Kerberos authentication |  |  | ✓
All other core features | ✓ |  |

* Now a core feature in v20.1.

Note:

Individual feature licensing may change with each release of CockroachDB. You can use the dropdown menu at the top of the page to view documentation for other versions of CockroachDB.

Note:

More information about all enterprise features can be found here.

## Obtain a license

All CockroachDB code is included in the same binary. No license key is required to access BSL and CCL (Free) features. To access CCL (Paid) features, users have two options:

- An Enterprise License enables you to use CockroachDB enterprise features for longer periods (one year or more). To upgrade to an enterprise license, contact Sales.
- A Trial License enables you to try out CockroachDB enterprise features for 30 days for free. To obtain a trial license, fill out the registration form and receive your trial license via email within a few minutes.

Tip:

For quick local testing of enterprise features, you can use the `cockroach demo` command, which starts a temporary, in-memory cluster with a SQL shell open and a trial license applied automatically.

Note:

Cockroach Labs is willing to offer self-hosted CockroachDB enterprise features free of charge and discounted prices for CockroachCloud to select non-profit organizations and non-commercial academic projects. To learn more, please contact us.

## Set a license

As the CockroachDB `root` user, open the built-in SQL shell in insecure or secure mode, as per your CockroachDB setup. In the following example, we assume that CockroachDB is running in insecure mode. Then use the `SET CLUSTER SETTING` command to set the name of your organization and the license key:

    $ cockroach sql --insecure

    >  SET CLUSTER SETTING cluster.organization = 'Acme Company';

    >  SET CLUSTER SETTING enterprise.license = 'xxxxxxxxxxxx';

## Verify a license

To verify a license, open the built-in SQL shell and use the `SHOW CLUSTER SETTING` command to check the organization name and license key:

    >  SHOW CLUSTER SETTING cluster.organization;

      cluster.organization
    +----------------------+
      Acme Company
    (1 row)

    >  SHOW CLUSTER SETTING enterprise.license;

                 enterprise.license
    +-------------------------------------------+
      crl-0-ChB1x...
    (1 row)

The license setting is also logged in the cockroach.log on the node where the command is run:

    $ cat cockroach.log | grep license

    I171116 18:11:48.279604 1514 sql/event_log.go:102  [client=[::1]:56357,user=root,n1] Event: "set_cluster_setting", target: 0, info: {SettingName:enterprise.license Value:xxxxxxxxxxxx User:root}

## Renew an expired license

After your license expires, the enterprise features stop working, but your production setup is unaffected. For example, the backup and restore features would not work until the license is renewed, but you would be able to continue using all other features of CockroachDB without interruption.

To renew an expired license, contact Sales and then set the new license.

## FAQs

### Can I host CockroachDB as a service for internal use at my organization?

Yes, employees and contractors can use your internal CockroachDB instance as a service, but no people outside of your organization will be able to use it without purchasing a license. Use of enterprise features will always require a license.

### What constitutes hosting CockroachDB as a service?

Hosting CockroachDB as a service means creating an offering that allows third parties (other than your employees and contractors) to operate a database. Specifically, third parties cannot modify table schemas.

### I would like to reuse a single component from the CockroachDB project in my own software, which uses the AGPL or another open-source license. Is this possible?

The CockroachDB team is committed to supporting the open-source community and willing to consider extracting specific internal components that are generally useful as a separate project with its own license, for example APL. For more details, feel free to contact us.

### Can I fork the CockroachDB project pre-BSL and create my own CockroachDB derivative with a different license?

You can fork any historical version of CockroachDB in your own project, as allowed by the license available for that version, and modify it for your purpose. Note however that only the copyright holder (Cockroach Labs) can relicense the components that you forked from: your derivative will need to keep the original license at the time of the fork. Any component you copy from a BSL-licensed CockroachDB into your project will make the BSL apply to your project as well.