> For the complete documentation index, see [llms.txt](https://docs.octoxlabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.octoxlabs.com/documentation/use-octoxlabs/settings/account-and-tenant-management/companies.md).

# Companies

Run several isolated tenants on one OctoXLabs installation: create companies, manage their domains, licence inheritance and administrators.

A **company** is a tenant. Each company has its own users, groups, data and settings, is reached on its own domain, and is kept apart from the others. Use companies when one OctoXLabs installation serves several customers, business units or environments that must not see each other's data (for example a managed service provider).

Every installation has one root company, created at install time. It cannot be deleted. All other companies are created from it.

### Before you begin

* Required role: an administrator of the root company. The company permissions (`companies.view_company`, `companies.add_company`, `companies.change_company`, `companies.delete_company`) are administrator-only.
* Your licence limits the number of licensed companies (**Max. Company Count** in Product Licence).
* A DNS name for each company's domain, pointing to the OctoXLabs server. See Custom domains.

Go to the gear icon in the top bar > **Settings** > **Account and Tenant Management** > **Companies**.

### The company list

The table shows **Name**, **Inherit License** and **Active**. A new company stays inactive while its setup runs, and its edit action stays disabled until it becomes active. The root company cannot be deleted.

### Create a company

{% stepper %}
{% step %}

#### Open the form

Click **Create Company**.
{% endstep %}

{% step %}

#### Name it and choose the licence

Enter **Company Name**. Select **Inherit License** if the company should use the root company's licence. Inheriting counts against **Max. Company Count**: the root company plus all inheriting companies cannot exceed it.
{% endstep %}

{% step %}

#### Create and wait

Click **Create**. The company appears in the list and its setup runs in the background. This can take a few minutes. When **Active** is set, open it to add domains and administrators.
{% endstep %}
{% endstepper %}

The name must be unique and must produce a valid schema name (letters and digits; spaces, dashes, underscores and dots are dropped). HTML in the name is rejected.

### Edit a company

Click the edit action. The page has three sections.

**Basic Info.** Change the **Company Name**, then click **Save**. Renaming also renames the company's schema. **Inherit License** is not shown for the root company. Changing it can be done from the root company only. Clearing it resets the company's licence to the demo licence.

**Domains.** A company is reached by its domain. The table shows **#**, **Domain** and **Set as Primary**.

* Click **Create New Domain**, enter the **Domain** and save.
* In the **Set as Primary** column, click **Click to set** to make a domain the primary one. The primary domain shows **Primary**.
* Use the edit action to rename a domain, and the delete action to remove it. You cannot delete the primary domain or the domain you are currently using.

**Administrator.** Pick a user in the search box and click **Add as Company Admin**. This creates an administrator account in that company with the same name and e-mail, and a username that ends with `(CA)`. Use the delete action in the table to remove it.

### Work in another company

If you administer more than one company, a company drop-down appears in the top bar. Choose a company and OctoXLabs signs you in to that company's domain with the `(CA)` account. Company administrators cannot change their own username or password in Account Settings; the platform manages the account.

{% hint style="danger" %}
Deleting a company removes its database schema and its domains. Export what you need first. Deletion cannot be undone.
{% endhint %}

### Verify the result

* The company shows **Active** in the list.
* The new domain resolves and opens the company sign-in page.
* The company administrator sees the company in the top bar drop-down.

### Troubleshooting

| Symptom or error message                                                           | Cause                                                                              | Fix                                                                         |
| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
| `This company name unavailable.` or `This company name unavailable: <name>.`       | A company or schema with the same generated name exists, or the name is not valid. | Choose another name.                                                        |
| `Your license supports up to <n> licensed companies. You have reached this limit.` | **Inherit License** would exceed **Max. Company Count**.                           | Create the company without inheritance, or raise the limit in your licence. |
| `License inheritance can only be managed from the root company.`                   | You changed **Inherit License** while signed in to another company.                | Switch to the root company.                                                 |
| `Root company cannot inherit license.`                                             | **Inherit License** was set on the root company.                                   | Not applicable to the root company.                                         |
| `You cannot delete primary domain.` or `You cannot delete active domain.`          | The domain is primary or in use.                                                   | Set another domain as primary, and sign in on a different domain.           |
| `This user already exists in <company> company.`                                   | The user is already an administrator of that company.                              | Pick another user.                                                          |
| The edit action is disabled                                                        | The company is still being set up.                                                 | Wait for **Active**, then reload the list.                                  |

### What's next?

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Users</strong></td><td>Create accounts inside a company.</td><td></td></tr><tr><td><strong>Product Licence</strong></td><td>Check how many companies your licence allows.</td><td></td></tr><tr><td><strong>Custom domains</strong></td><td>Serve OctoXLabs on your own domain name.</td><td></td></tr></tbody></table>
