Skip to main content
You can run Coral as a shared server that you host yourself. You and your team then share workspaces, providers and tool policies. You can also share provider credentials with the members of a workspace. Self-hosted Coral has two components:
  • coral: the Docker image with the Coral server. It includes the runtime, the provider configuration, the policies, the authentication server and the MCP server.
  • coral-web: the Coral UI, where you and your team manage Coral.
You can deploy Coral with Docker Compose or Kubernetes.

Before you start

  • An OIDC identity provider. Self-hosted Coral uses your own identity provider (IdP) to authenticate users. Any OIDC-compatible IdP works, such as Okta, Google Workspace or WorkOS. Configure an application for Coral at your IdP.
  • A database. Coral supports SQLite and Postgres. SQLite is the default. Choose the one that fits your setup. Postgres needs the pgvector extension for semantic search.
  • TLS termination. Coral requires TLS for user-facing connections, but Coral does not provide TLS itself. Use your preferred reverse proxy, such as nginx or Envoy. If you have none, use Caddy.
  • Public endpoints. Coral uses three endpoints that your users’ systems must be able to reach. <coral-host> is the placeholder for the root domain of your Coral deployment:
    • <coral-host>: the URL of the Coral UI (coral-web).
    • auth.<coral-host>: the auth endpoint. coral-web and the MCP server use it to authenticate users.
    • mcp.<coral-host>: the MCP server endpoint.
Make sure that you can point these names at your Coral deployment. The deployment guides have the details. Also make sure that you can create valid TLS certificates for these domains. Semantic search finds tools by what a query means, not only by its words. A model in the Coral process compares the meaning of a query with the text of each tool. No text goes out of your deployment. Semantic search is on by default. To turn it off, set semantic_search_enabled = false in [search]. Restart Coral after you change the setting. See the configuration reference.

Postgres needs pgvector

With Postgres, semantic search needs the pgvector extension, version 0.7 or later. With SQLite, you do not need to do anything. Before you upgrade Coral on Postgres, install pgvector or turn the setting off. At startup, Coral creates the vector extension when pgvector is installed and Coral’s database role may create it: a superuser, or the master user on Amazon RDS. If the extension is not available, Coral does not start and reports an error such as:
To correct the error, do one of these steps:
  • Install pgvector 0.7 or later on your Postgres server. Then, as a superuser, run CREATE EXTENSION vector; in Coral’s database. Use a schema on the search path of Coral’s database role.
  • Set semantic_search_enabled = false in [search]. Coral then does not check for pgvector.
Many managed Postgres services include pgvector, for example Amazon RDS. On Amazon RDS, the master user can create the extension.

The model

The ghcr.io/withcoral/coral image holds the model, so Coral does not download it. Without the image, Coral looks for model.onnx and tokenizer.json in these folders, in this order:
  1. /opt/coral/models/bge-small-en-v1.5/. Coral looks here on Linux only.
  2. models/bge-small-en-v1.5/ in Coral’s configuration folder.
If neither folder holds the files, Coral downloads them from GitHub into the second folder. The [outbound] policy applies, so the host must reach GitHub. Then Coral tries to delete the other folders in models. Until the files are ready, search matches by words only. If Coral cannot read a model file, it reports the file and does not download. If a downloaded file is not correct, Coral tries again at its next start. A host without network access cannot download the files. On such a host, do one of these steps:
  • Download model.onnx and tokenizer.json from the model release. Put both files in one of the folders above.
  • Set semantic_search_enabled = false in [search].
Coral uses a folder only when the SHA-256 of both files is correct. When Coral finds the files, its log shows Coral search model ready in <folder>.

Cost

  • Memory. The Coral process uses up to about 360 MiB more memory while it embeds tools on one thread. Each thread after the first loads one more copy of the model and uses up to about 200 MiB more.
  • CPU. By default, Coral embeds tools on one background thread at low priority. All workspaces share this thread. On a host with idle cores, set embedder_cores in [search] to the number of threads. The default is 1. More threads embed faster, but not in proportion. In a measurement of the model alone on an Apple M4 Pro, 4 threads embed about 3 times as many tools a second as 1 thread, and 8 threads about 4.9 times as many. Search requests still go before the tools that wait.
  • Time. A new provider matches by words only until Coral embeds its tools. A provider with about 20,000 tools takes about 12 minutes on one x86 vCPU. Ten such providers take about two hours. When you change a provider, Coral embeds only the tools whose text changed, and those tools match by words only until then. The other tools keep their vectors while Coral still stores the provider’s previous version. A background pass removes that version every reconcile_interval_seconds (5 minutes by default), so when Coral is busy embedding other tools, it can embed unchanged tools again. Vectors from an earlier Coral version do not record their text, so the first change after an upgrade embeds all the tools of the provider again.
  • Database. In Postgres, the vectors of 20,000 tools use about 26 MB. Search is fast while the database server keeps them in memory.
  • Disk. The model files use about 133 MB.

Older CPUs

On an x86-64 CPU, semantic search needs the x86-64-v3 features, such as AVX2. On an older CPU, Coral starts and does not download the model. Search matches by words only. To examine a Linux host with glibc 2.33 or later, run /lib64/ld-linux-x86-64.so.2 --help. The CPU has the features when the output shows x86-64-v3 (supported, searched). Rosetta, which runs linux/amd64 containers on Apple Silicon Macs, does not have these features.

Upgrade Coral

Coral updates its own database when a new version starts. You don’t run a separate migration step. To upgrade:
  1. Read the release notes for the versions between yours and the new one.
  2. Back up Coral’s state:
    • SQLite. Stop Coral, then copy the volume mounted at /var/lib/coral. It holds the database and the credentials key.
    • Postgres. Take a dump or a snapshot of the database. Keep the value of CORAL_CREDENTIALS_KEY with it.
  3. Start the new coral and coral-web images. Upgrade both to the same version.
To return to an earlier version, restore the backup and start that version. The Docker Compose and Kubernetes guides have the commands.

Upgrade from Coral 0.x

Coral 1.0 is a rewrite from the ground up. Your agents now write TypeScript programs that call your providers. In 0.x, they ran SQL queries over sources. You now manage Coral in the Coral UI, where 0.x used coral commands. Your agents now connect to the MCP server over HTTP, where 0.x used stdio. So 1.0 is a breaking change. It starts from fresh state and doesn’t convert what 0.x stored. Your 0.x setup stays as it is until you’re ready to switch. The Coral 1.0 runtime stops when it starts on a configuration folder or a database that an earlier version wrote. It reports an error such as:
Coral never deletes, converts or archives old state. Don’t start a Coral 1.0 container on a 0.x volume, because the container overwrites config.toml there. To start Coral 1.0:
  1. Stop the old Coral. Copy its configuration folder, or its volume, and keep the copy for as long as you need it.
  2. Give Coral 1.0 fresh state. Set CORAL_CONFIG_DIR to an empty folder or, in containers, mount a new volume. With Postgres, point Coral at an empty database.
  3. Write a new configuration from the configuration reference, or follow one of the guides below. Coral 1.0 rejects a 0.x configuration file.
  4. Start Coral, then add your providers and connect your accounts again.
  5. Point your agents’ MCP clients at the new MCP endpoint.
To go back, stop Coral 1.0 and start the old version on the copy you kept.

Detailed guides

Deploy with Docker Compose

Deploy with Kubernetes