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

# Set up an Ark server with Docker Compose

> Run an Ark server with Docker Compose. All-in-one containerized setup with PostgreSQL, Bitcoin Core, captaind, and optionally Core Lightning on regtest.

All dependencies are included and configured automatically. The optional Core Lightning service ships with [Boltz's hold plugin](https://github.com/BoltzExchange/hold).

> [!NOTE]
>
> This path runs on **regtest**, a local-only test network. If you'd prefer to run on signet with each component installed individually, see the [manual setup guide](https://second.tech/docs/ark-server/manual-setup.md) instead.

The Compose file handles boot-time dependencies and initializations using `depends_on` and health checks.

## Start the server

**1. Clone the repository**

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
git clone https://gitlab.com/ark-bitcoin/bark
cd bark
```

**2. Start all services**

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
docker compose -f contrib/docker/docker-compose.yml up
```

**3. Verify services are running**

Once everything is up, you can run commands against the containers:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
# bark
docker compose -f contrib/docker/docker-compose.yml run --rm bark bark ark-info

# bitcoin-cli
docker compose -f contrib/docker/docker-compose.yml run --rm bitcoind \
  bitcoin-cli -regtest -rpcuser=second -rpcpassword=ark \
  -rpcconnect=bitcoind getblockchaininfo

# captaind
docker compose -f contrib/docker/docker-compose.yml run --rm captaind \
  captaind --config /root/captaind/captaind.toml get-mnemonic

# Core Lightning
docker compose -f contrib/docker/docker-compose.yml exec cln \
  lightning-cli --regtest getinfo
```

> [accordion] Shared volumes
>
> * `captaind` — persistent data for `captaind`
> * `postgres` — PostgreSQL database files
> * `bark` — data for `bark`
> * `bitcoind` — Bitcoin Core blockchain and wallet data
> * `cln` — Core Lightning node data

## Fund the server

Generate some regtest blocks and send bitcoin to the server:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
# Get the server's funding address
export CAPTAIND_ADDRESS=$(docker compose -f contrib/docker/docker-compose.yml run --rm captaind \
  captaind --config /root/captaind/captaind.toml rpc wallet | jq -r '.rounds.address')

# Generate blocks
docker compose -f contrib/docker/docker-compose.yml run --rm bitcoind \
  bitcoin-cli -regtest -rpcuser=second -rpcpassword=ark \
  -rpcconnect=bitcoind -generate 106

# Send bitcoin to the server
docker compose -f contrib/docker/docker-compose.yml run --rm bitcoind \
  bitcoin-cli -regtest -rpcuser=second -rpcpassword=ark \
  -rpcconnect=bitcoind sendtoaddress $CAPTAIND_ADDRESS 1
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.