Skip to content

A Docker image based on Debian Linux ready to run a bitcoin full node!

License

Notifications You must be signed in to change notification settings

legacycode/bitcoind-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bitcoind Docker Image

MicroBadger Layers Docker Pulls Docker Stars Codacy grade CircleCI

Introduction

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.

Supported tags and architectures

This bitcoind images supports following tags for e.g. Linux, Raspberry, Pine64 etc.:

This images supports following architectures (more info):

  • amd64 - for most desktop processors
  • arm7v - for 32-Bit ARM images like Raspbian (Raspberry 1, 2, 3 and 4)
  • arm64 - for 64-Bit ARM images like armbian (Pine 64, etc.)

Starting your bitcoind node

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:

  1. 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:
  2. Run the container by entering the following command into your terminal: docker-compose up

Docker volumes

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.

License

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.