> ## Documentation Index
> Fetch the complete documentation index at: https://docs.firebolt.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Deployment using Docker Compose

You can use Docker Compose to create a multi-node Firebolt Core deployment.
This is useful if you have multiple hosts that are already on the same network (for example, your home or office LAN); if you have remote machines available on Kubernetes, see [Deploy using Kubernetes](/firebolt-core/firebolt-core-operation/firebolt-core-deployment-k8s) instead.

For the purpose of this example, we will assume that the hostnames of these machines are `example-node-a` and `example-node-b`; you can use an arbitrary number of nodes, but beware that you cannot add them later after the cluster has been started.

## Configuration

On both `example-node-a` and `example-node-b` you will need to clone the repository:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
git clone https://github.com/firebolt-db/firebolt-core
```

And then create the following `config.json` file.

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
    "nodes": [
        {
            "host": "example-node-a"
        },
        {
            "host": "example-node-b"
        }
    ]
}
```

<Note>
  Docker Compose deployments use local directory bind mounts for persistence. This means the local filesystem is the only copy of your data — there is no object storage backing. This setup is suitable for development and testing, but is **not recommended for production**. For production deployments, use the [Kubernetes deployment](/firebolt-core/firebolt-core-operation/firebolt-core-deployment-k8s) with [object storage configured](/firebolt-core/firebolt-core-operation/firebolt-core-object-storage-access/firebolt-core-object-storage-access-s3). See [Data durability](/firebolt-core/firebolt-core-operation/firebolt-core-fault-tolerance#data-durability) for details.
</Note>

Persistence is already enabled by default on each of the nodes through the mounted local directory `firebolt-core-data`, which you will need to create and assign correct permissions:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
mkdir -p ./firebolt-core-data
sudo chown -R 1111:1111 ./firebolt-core-data
```

If your hosts are running macOS, use before each `docker compose` command:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
CORE_USER=root docker compose ...
```

## Node 0 start

Run:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
docker compose up
```

On the cloned repository directory on `example-node-a`; this will start the first Firebolt Core node. Please note that attempting to send queries to its HTTP endpoint will return an HTTP 500 error since the cluster is not yet healthy - this is expected because the second node is not yet up and running.

## Node 1 start

Run:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
NODE=1 docker compose -f compose.yaml up
```

On the cloned repository directory on `example-node-b`; this will start the second Firebolt Core node.

## Further nodes

For any further node repeat the steps for node 1 and use an incremental `NODE` (e.g. 2 and so on).

## Querying

You can now query each node independently, directly utilizing their resources:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -s "http://example-node-a:3473" --data-binary "select 42";
curl -s "http://example-node-b:3473" --data-binary "select 42";
```

[fb-cli](https://github.com/firebolt-db/fb-cli) is also present within each of the Docker containers, you can invoke it with:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
docker exec -ti firebolt-core-node-0 fbcli
```

## Web UI

Each of the hosts will also have a web UI available on port `9100`.
