{"id":13746468,"url":"https://github.com/Chia-Network/chia-docker","last_synced_at":"2025-05-09T07:30:43.149Z","repository":{"id":40416836,"uuid":"343506843","full_name":"Chia-Network/chia-docker","owner":"Chia-Network","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-17T16:30:39.000Z","size":276,"stargazers_count":215,"open_issues_count":3,"forks_count":338,"subscribers_count":41,"default_branch":"main","last_synced_at":"2025-04-18T06:50:42.096Z","etag":null,"topics":["chia","chia-blockchain","docker"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Chia-Network.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-03-01T17:51:20.000Z","updated_at":"2025-04-17T16:30:41.000Z","dependencies_parsed_at":"2024-01-19T19:25:39.818Z","dependency_job_id":"20bc4645-9815-4a96-bb29-a3482255b783","html_url":"https://github.com/Chia-Network/chia-docker","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chia-Network%2Fchia-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chia-Network%2Fchia-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chia-Network%2Fchia-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chia-Network%2Fchia-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Chia-Network","download_url":"https://codeload.github.com/Chia-Network/chia-docker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253209256,"owners_count":21871622,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chia","chia-blockchain","docker"],"created_at":"2024-08-03T06:00:54.115Z","updated_at":"2025-05-09T07:30:43.136Z","avatar_url":"https://github.com/Chia-Network.png","language":"Shell","readme":"# Official Chia Docker Container\n\n## Quick Start\n\nThese examples shows valid setups using Chia for both docker run and docker-compose. Note that you should read some documentation at some point, but this is a good place to start.\n\n### Docker run\nSimple example:\n```bash\ndocker run --name chia --expose=8444 -v /path/to/plots:/plots -d ghcr.io/chia-network/chia:latest\n```\nSyntax\n```bash\ndocker run [--name \u003ccontainer-name\u003e] [--expose=\u003cport\u003e] [-v \u003c/path/to/plots:/plots\u003e] -d ghcr.io/chia-network/chia:latest\n```\nOptional Docker parameters:\n- Give the container a name: `--name=chia`\n- Accept incoming connections: `--expose=8444`\n- Volume mount plots: `-v /path/to/plots:/plots`\n\n\n### Docker compose\n\n```yaml\nversion: \"3.6\"\nservices:\n  chia:\n    container_name: chia\n    restart: unless-stopped\n    image: ghcr.io/chia-network/chia:latest\n    ports:\n      - 8444:8444\n    volumes:\n      - /path/to/plots:/plots\n```\n\n## Configuration\n\nYou can modify the behavior of your Chia container by setting specific environment variables.\n\n### Timezone\n\nSet the timezone for the container (optional, defaults to UTC).\nTimezones can be configured using the `TZ` env variable. A list of supported time zones can be found [here](http://manpages.ubuntu.com/manpages/focal/man3/DateTime::TimeZone::Catalog.3pm.html)\n```bash\n-e TZ=\"America/Chicago\"\n```\n\n### Add your custom keys\n\nTo use your own keys pass a file with your mnemonic as arguments on startup\n```bash\n-v /path/to/key/file:/path/in/container -e keys=\"/path/in/container\"\n```\nor pass keys into the running container with your mnemonic\n```bash\ndocker exec -it \u003ccontainer-name\u003e venv/bin/chia keys add\n```\nalternatively you can pass in your local keychain, if you have previously deployed chia with these keys on the host machine\n```bash\n-v ~/.local/share/python_keyring/:/root/.local/share/python_keyring/\n```\nor if you would like to persist the entire mainnet subdirectory and not touch the key directories at all\n```bash\n-v ~/.chia/mainnet:/root/.chia/mainnet -e keys=\"persistent\"\n```\n\n\n### Persist configuration, db, and keyring\n\nYou can persist whole db and configuration, simply mount it to Host.\n```bash\n-v ~/.chia:/root/.chia \\\n-v ~/.chia_keys:/root/.chia_keys\n```\n\n### Farmer only\n\nTo start a farmer only node pass\n```bash\n-e service=\"farmer-only\"\n```\n\n### Harvester only\n\nTo start a harvester only node pass\n```bash\n-e service=\"harvester\" -e farmer_address=\"addres.of.farmer\" -e farmer_port=\"portnumber\" -v /path/to/ssl/ca:/path/in/container -e ca=\"/path/in/container\" -e keys=\"none\"\n```\n\n### Configure full_node peer\n\nTo set the full_node peer's hostname and port, set the \"full_node_peer\" environment variable with the format `hostname:port`\n```bash\n-e full_node_peer=\"node:8444\"\n```\nThis will configure the full_node peer hostname and port for the wallet, farmer, and timelord sections of the config.yaml file.\n\n### Configure trusted full_nodes peers for wallets\n\nYou can specify a list of trusted full_node peers for your wallet by setting the `trusted_peers` environment variable with a comma-separated list of address:port pairs.\n\nNOTE: You should only configure trusted full_nodes that you manage.\n\n```bash\n-e trusted_peers==\"1.2.3.4:8444,4.3.2.1:8444\"\n```\n\nAt this time, only IP addresses are supported. Domains will not be added to your config as a trusted peer.\n\nSee the [trusted peer documentation](https://docs.chia.net/faq/?_highlight=trusted#what-are-trusted-peers-and-how-do-i-add-them) to understand what trusted nodes are.\n\n### Plots\n\nThe `plots_dir` environment variable can be used to specify the directory containing the plots, it supports PATH-style colon-separated directories.\n\nOr, you can simply mount `/plots` path to your host machine.\n\nSet the environment variable `recursive_plot_scan` to `true` to enable the recursive plot scan configuration option.\n\n### Adding mounts while running\n\nBy default, Docker requires a container restart to discover newly mounted filesystems under a configured bind-mount. Setting the bind-propagation option to `rslave` enables dynamic addition of sub-mounts while the container is running (Linux systems only). [See Docker Bind Mounts documentation for more information.](https://docs.docker.com/storage/bind-mounts/#configure-bind-propagation)\n```bash\n-v /plotdrives:/plotdrives:rslave\n```\n\n### Compressed Plots\n\nThere are a few environment variables that control compressed plot settings for Harvesters ran with chia-docker. The default settings leave compressed plot harvesting disabled, but it can be enabled.\n\nSee the [official documentation](https://docs.chia.net/farming-compressed-plots/#cli) for a description on what each of these settings do.\n\nCompressed plot farming can be enabled by setting the following:\n\n```bash\n-e parallel_decompressor_count=1\n-e decompressor_thread_count=1\n```\n\nAnd to use an nvidia GPU for plot decompression, set:\n\n```bash\n-e use_gpu_harvesting=\"true\"\n```\n\n### Log level\nTo set the log level to one of CRITICAL, ERROR, WARNING, INFO, DEBUG, NOTSET\n```bash\n-e log_level=\"DEBUG\"\n```\n\n### Peer Count\nTo set the peer_count and outbound_peer_count\n\nfor example to set both to 20 use\n```bash\n-e peer_count=\"20\"\n```\n\n```bash\n-e outbound_peer_count=\"20\"\n```\n\n### UPnP\nTo disable UPnP support (enabled by default)\n```bash\n-e upnp=\"false\"\n```\n\n### Log to file\nLog file can be used by external tools like chiadog, etc. Enabled by default.\n\nTo disable log file generation, use\n```bash\n-e log_to_file=\"false\"\n```\n\n### Docker Compose\n\n```yaml\nversion: \"3.6\"\nservices:\n  chia:\n    container_name: chia\n    restart: unless-stopped\n    image: ghcr.io/chia-network/chia:latest\n    ports:\n      - 8444:8444\n    environment:\n      # Farmer Only\n#     service: farmer-only\n      # Harvester Only\n#     service: harvester\n#     farmer_address: 192.168.0.10\n#     farmer_port: 8447\n#     ca: /path/in/container\n#     keys: generate\n      # Harvester Only END\n      # If you would like to add keys manually via mnemonic file\n#     keys: /path/in/container\n      # OR\n      # Disable key generation on start\n#     keys: \n      TZ: ${TZ}\n      # Enable UPnP\n#     upnp: \"true\"\n      # Enable log file generation\n#     log_to_file: \"true\"\n    volumes:\n      - /path/to/plots:/plots\n      - /home/user/.chia:/root/.chia\n#     - /home/user/mnemonic:/path/in/container\n```\n\n## CLI\n\nYou can run commands externally with venv (this works for most chia [CLI commands](https://github.com/Chia-Network/chia-blockchain/wiki/CLI-Commands-Reference))\n```bash\ndocker exec -it chia venv/bin/chia plots add -d /plots\n```\n\n### Is it working?\n\nYou can see status from outside the container\n```bash\n$ docker exec -it chia venv/bin/chia farm summary\nFarming status: Farming\nTotal chia farmed: xx\nUser transaction fees: xx\nBlock rewards: xx\nLast height farmed: xxxxxxx\nLocal Harvester\n   xxx plots of size: xx.xxx TiB\nPlot count for all harvesters: xxx\nTotal size of plots: xx.xxx TiB\nEstimated network space: 30.638 EiB\nExpected time to win: x months and x weeks\nNote: log into your key using 'chia wallet show' to see rewards for each key\n```\n\nOr via `chia peer`. Note that you have to specify your component.\n\n```bash\ndocker exec -it chia venv/bin/chia peer -c {farmer|wallet|full_node|harvester|data_layer}\n```\n\nOr via `chia show -s`.\n\n```bash\n$ docker exec -it chia venv/bin/chia show -s\nNetwork: mainnet    Port: 8444   RPC Port: 8555\nNode ID: xxxxx\nGenesis Challenge: xxxxx\nCurrent Blockchain Status: Full Node Synced\n\nPeak: Hash: xxxxx\n      Time: Fri Jan 19 2024 17:52:44 CET                  Height:    4823454\n\nEstimated network space: 30.639 EiB\nCurrent difficulty: 11136\nCurrent VDF sub_slot_iters: 574619648\n\n  Height: |   Hash:\n  4823454 | 7e66bd11e46801b25ac9237e300deff27a4750fc3bf4eb7e3c594b17faaf0b37\n  4823453 | 9f5b68a52364c1afec48bc87d26bbba912c355e7f51c970f7bf89d068c762530\n  4823452 | db3b5bb0e3d09fd398e2d9bd159c387f9ad280ec8719916ebb6c25c948834f9c\n  4823451 | 5dd056960ec14da1c54fe295f33487e280f3e3c39eddced158ebb520b8215894\n  4823450 | a3f5a3f61728b1f52e1ab7971b29d0c55b6bc8e2797ad826b780ada7a0f76a49\n  4823449 | 052075e6b9881049c95c3ceeabed9160e5bfbf55a2b3b0768a743542ce88a3a3\n  4823448 | 3e2b954d4eb782d1ce67eb7f17e9bf72843d17948ba181168dbc239c5e70acd2\n  4823447 | 69539a9474c239280b6a6b4ab5be994e892c1b75c7bfb8967517e75ee5a65b12\n  4823446 | 47ce031f46b2b0c9f90e90de4f9cab58054f356a7a3019b30c8f6292b86a5aae\n  4823445 | 8c5d0254db6e304696d240dc70bad803ad227b861d68e65a3dc30c0aeef298f6\n\n```\n\n### Connect to testnet?\n\n```bash\ndocker run -d --expose=58444 -e testnet=true --name chia ghcr.io/chia-network/chia:latest\n```\n\n### Connect remotely\n\nSometimes you may want to access Chia RPCs from outside of the container, or connect a GUI to a remote Chia farm. In those instances, you may need to configure the `self_hostname` key in the Chia config file.\n\nBy default this is set to `127.0.0.1` in chia-docker, but can be configured using the `self_hostname` environment variable, like so:\n\n```bash\ndocker run -d -e self_hostname=\"0.0.0.0\" --name chia ghcr.io/chia-network/chia:latest\n```\n\nThis sets self_hostname in the config to `0.0.0.0`, which will allow you to access the Chia RPC from outside of the container (you will still need a copy of the private cert/key for the component you're attempting to access.)\n\n#### Need a wallet?\n\nTo get new wallet, execute command and follow the prompts:\n\n```bash\ndocker exec -it chia-farmer1 venv/bin/chia wallet show\n```\n\n## Building\n\n```bash\ndocker build -t chia --build-arg BRANCH=latest .\n```\n\n## Healthchecks\n\nThe Dockerfile includes a HEALTHCHECK instruction that runs one or more curl commands against the Chia RPC API. In Docker, this can be disabled using an environment variable `-e healthcheck=false` as part of the `docker run` command. Or in docker-compose you can add it to your Chia service, like so:\n\n```yaml\nversion: \"3.6\"\nservices:\n  chia:\n    ...\n    environment:\n      healthcheck: \"false\"\n```\n\nIn Kubernetes, Docker healthchecks are disabled by default. Instead, readiness and liveness probes should be used, which can be configured in a Pod or Deployment manifest file like the following:\n\n```yaml\nlivenessProbe:\n  exec:\n    command:\n    - /bin/sh\n    - -c\n    - '/usr/local/bin/docker-healthcheck.sh || exit 1'\n  initialDelaySeconds: 60\nreadinessProbe:\n  exec:\n    command:\n    - /bin/sh\n    - -c\n    - '/usr/local/bin/docker-healthcheck.sh || exit 1'\n  initialDelaySeconds: 60\n```\n\nSee [Configure Probes](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#configure-probes) for more information about configuring readiness and liveness probes for Kubernetes clusters. The `initialDelaySeconds` parameter may need to be adjusted higher or lower depending on the speed to start up on the host the container is running on.\n\n## Simulator\n\n`docker run -e service=simulator -v /local/path/to/simulator:/root/.chia/simulator ghcr.io/chia-network/chia:latest`\n\nMounts the simulator root to the provided local path to make the test plots and the mnemonic persistent. Mnemonic will be available at /local/path/to/simulator/mnemonic\n","funding_links":[],"categories":["Smart Contract Platforms"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FChia-Network%2Fchia-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FChia-Network%2Fchia-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FChia-Network%2Fchia-docker/lists"}