# Docker compose Docker Compose allows us to operate our Bee nodes as simple to manage Docker containers, and the setup provided here can be easily expanded in order to run a full "hive" of Bee nodes. Execute the following commands to set up a `bee` folder to download the `docker-compose.yml` and `.env` files. ``` mkdir -p bee && cd bee wget -q https://raw.githubusercontent.com/ethersphere/bee/master/packaging/docker/docker-compose.yml wget -q https://raw.githubusercontent.com/ethersphere/bee/master/packaging/docker/env -O .env ``` ## Environment Variable Configuration Set all configuration variables inside `env`, and rename the file to `.env`. See [the docs](https://docs.ethswarm.org/docs/bee/working-with-bee/configuration) for more info about these variables. If you want to run a full node, make sure to set `BEE_FULL_NODE=true`. We strongly recommend you run your own [Gnosis Chain](https://www.gnosis.io/) node if you are planning to run a full node, and especially if you plan to run a hive of nodes. If you do not wish to run your own Gnosis Chain node and are willing to trust a third party, you may also consider using one of the paid RPC endpoint providers listed in the [Gnosis Chain docs](https://docs.gnosischain.com/tools/rpc/), such as GetBlock. For running a light node or for testing out a single full node you may also consider using one of the [free public RPC endpoints](https://docs.gnosischain.com/tools/rpc/) also listed in the Gnosis Chain documentation. However the providers of these free endpoints make no guarantees for the availability and quality of their services, and some may be rate limited, and are therefore not recommended for full node operators. Set the `BEE_BLOCKCHAIN_RPC_ENDPOINT` variable using your endpoint. - `BEE_BLOCKCHAIN_RPC_ENDPOINT=https://gno.getblock.io/<<your-api-key>>/mainnet/` Set bee password by either supplying the password directly as a string in `BEE_PASSWORD` or the location of the password file in `BEE_PASSWORD_FILE`. If you want to use a password file set it to - `BEE_PASSWORD_FILE=/password` ## Docker Compose Configuration In order to make our password accessible to our Bee container, we mount it by adding the following line under `volumes:` under our `bee-1` service in `docker-compose.yml` . ``` - ./password:/password ``` ## Start Node Start the node with: ``` docker-compose up -d ``` When running your node for the first time, you need go find the node address and fund it with XDAI in order to pay for Gnosis Chain transactions. View the logs: ``` docker-compose logs -f bee-1 ``` And find your node's address from the line: ``` bee-bee-1-1 | "time"="2023-08-09 12:14:05.697879" "level"="info" "logger"="node" "msg"="using ethereum address" "address"="0x5397Ed9b77891C9B3debFb89449af9C58a5C2664" ``` Copy the address, and fund it with a small amount of XDAI. A single XDAI token should be enough to get started. Note that while this is an Ethereum format address, Swarm protocol operates on Gnosis Chain, so make sure when funding your node that you send the XDAI on Gnosis Chain, not the Ethereum mainnet. Update services with: ``` docker-compose pull && docker-compose up -d ``` ## Running multiple Bee nodes It's easy to run multiple bee nodes with Docker Compose by adding more services to `docker-compose.yaml`. To do so, open `docker-compose.yaml`, copy the entire `bee-1` service configuration, and paste it as a second entry under `services:`. In the copied lines, replace all occurrences of `bee-1` with `bee-2` and adjust the `API_ADDR` and `P2P_ADDR` and `DEBUG_API_ADDR` respectively to `1733`, `1734` and `127.0.0.1:1735` Lastly, add your newly configured services under `volumes` (last lines), such that it looks like: ```yaml volumes: bee-1: bee-2: ``` If you want to create more than two nodes, simply repeat the process above, ensuring that you keep unique name for your bee and clef services and update the ports