With Docker you can easily set up bitcoind and create your Bitcoin full node. The Docker source file of this image is located at Dockerfile.
This documentation focus on running Docker container with docker-compose.yml files. These files are better to read and you can use them as a template. For more information about Docker and Docker compose visit the official Docker documentation.
This bitcoind images supports following tags for e.g. Linux, Raspberry, Pine64 etc.:
This images supports following architectures (more info):
amd64
- for most desktop processorsarm7v
- for 32-Bit ARM images like Raspbian (Raspberry 1, 2, 3 and 4)arm64
- for 64-Bit ARM images like armbian (Pine 64, etc.)
To quick start your bitcoind node just clone this repository and run Docker:
git clone https://github.com/legacycode/bitcoind-docker.git
cd bitcoind-docker
docker-compose up -d
Or create the Docker compose file by yourself and run Docker:
-
Create a docker-compose.yml file with the following content:
version: "2" services: bitcoind: container_name: bitcoind hostname: bitcoind image: legacycode/bitcoind:latest restart: unless-stopped volumes: - bitcoind-data:/home/bitcoin/.bitcoin # For binding a local folder make sure that the folder permissions # are set to user id 999 and group id 999 (chown 999.999 /customFolder -R) # - /customFolder:/home/bitcoin/.bitcoin ports: - 8333:8333 command: [ "-server", "-txindex", ] volumes: bitcoind-data:
-
Run the container by entering the following command into your terminal:
docker-compose up
Special diskspace hint: The examples are using a Docker managed volume. The volume is named bitcoind-data This will use a lot of disk space, because it contains the full Bitcoin blockchain. Please make yourself familiar with Docker volumes.
The bitcoind-data volume will be reused, if you upgrade your docker-compose.yml file. Keep in mind, that the docker volume is not automatically removed by Docker, if you delete the bitcoind container. If you don't need the volume anymore, please delete it manually with the command:
docker volume ls
docker volume rm bitcoind-data
For binding a local folder to your bitcoind container please read the Docker documentation. The bitcoin user in the Docker container is running with user id 999 and group id 999. Make sure that your local folder have the right permissions set:
chown 999.999 /customFolder -R
The preferred way is to use a Docker managed volume.
This bitcoind Dockerfile is provided under the MIT License.
For license information about bitcoind visit the bitcoind GitHub source.
The Docker images are based on the Debian Docker image. Refer to the official Debian Docker image page for license information.