Using Docker for Hummingbot deployment offers several benefits, such as simplifying the installation process, enabling easy versioning and scaling, and ensuring a consistent and isolated environment for running the bot. This repository aims to help users get started with deploying Hummingbot using Docker by providing different examples that demonstrate how to set up and customize the bot according to their needs.
The examples below use Docker Compose, a tool for defining and running multi-container Docker applications. You can install Docker Compose either via command line or by running an installer.
Linux (Ubuntu / Debian):
sudo apt-get update
sudo apt-get install docker-compose-plugin
Mac (Homebrew):
brew install docker-compose
If you want to be guided through the installation, install Docker Desktop includes Docker Compose along with Docker Engine and Docker CLI which are Compose prerequisites:
Verify that Docker Compose is installed correctly by checking the version:
docker compose version
Hummingbot's deploy-examples repository provides various examples of how to deploy Hummingbot using Docker Compose, a tool for defining and running multi-container Docker applications.
Compiled images of hummingbot
are available on our official DockerHub: https://hub.docker.com/r/hummingbot/hummingbot
You can also build and run a Docker-based Hummingbot image using the docker-compose.yml
file in the root folder:
version: "3.9"
services:
hummingbot:
container_name: hummingbot
build:
context: .
dockerfile: Dockerfile
volumes:
- ./conf:/home/hummingbot/conf
- ./conf/connectors:/home/hummingbot/conf/connectors
- ./conf/strategies:/home/hummingbot/conf/strategies
- ./logs:/home/hummingbot/logs
- ./data:/home/hummingbot/data
- ./scripts:/home/hummingbot/scripts
environment:
# - CONFIG_PASSWORD=a
# - CONFIG_FILE_NAME=directional_strategy_rsi.py
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: 5
tty: true
stdin_open: true
network_mode: host
dashboard:
container_name: dashboard
image: hummingbot/dashboard:latest
volumes:
- ./data:/home/dashboard/data
ports:
- "8501:8501"
Build and launch the image by running:
docker compose up -d
Uncomment the following lines in the YML file before running the command above if you would like to:
- Bypass the password screen by entering the previously set password
- Auto-starting a script
# environment:
# - CONFIG_PASSWORD=a
# - CONFIG_FILE_NAME=directional_strategy_rsi.py
Use the commands below or use the Docker Desktop application to manage your containers:
docker compose up -d
docker compose down
docker compose up --force-recreate --build -d
sudo chmod -R a+rw <files/folders>
docker attach <container-name>
Press keys Ctrl + P then Ctrl + Q
docker compose up --force-recreate --build -d
docker ps -a
docker stop <container-name>
docker rm <container-name>