Dockerized Gunbot - Crypto Trading Bot.
Note: Gunbot only provides x86_64 (amd64) binaries. This image is built for
linux/amd64platform only. On Apple Silicon (M1/M2/M3), it runs via Rosetta/QEMU emulation.
- Multi-stage build for minimal image size
- Persistent data volume for configs and state
- Easy server migration - just copy the
data/folder - Non-root execution for security
- Synology NAS compatible (PUID/PGID support)
- GitHub Actions CI/CD for automated builds
git clone https://github.com/YOUR_USERNAME/gunbot-docker.git
cd gunbot-dockerdocker compose up -dOpen http://localhost:3000 in your browser.
| Variable | Default | Description |
|---|---|---|
TZ |
UTC |
Timezone |
PUID |
1000 |
User ID (for NAS compatibility) |
PGID |
1000 |
Group ID (for NAS compatibility) |
| Port | Description |
|---|---|
| 3000 | Web UI |
| 5000 | Alternative UI port |
The ./data directory is mounted to /data in the container. This contains:
| Path | Description |
|---|---|
config.js |
Main configuration (exchanges, pairs, strategies) |
autoconfig.json |
AutoConfig rules |
UTAconfig.json |
UTA configuration |
json/ |
Trading state and pair data |
backups/ |
Configuration backups |
customStrategies/ |
Custom JavaScript strategies |
gunbot_logs/ |
Gunbot logs |
To move to another server:
- Stop the container:
docker compose down - Copy the entire
data/folder to the new server - Start on new server:
docker compose up -d
Backup the data/ directory regularly. Critical files:
# Create a backup
tar -czvf gunbot-backup-$(date +%Y%m%d).tar.gz data/
# Restore from backup
tar -xzvf gunbot-backup-YYYYMMDD.tar.gzImportant: The config.js file contains your exchange API keys. Keep backups secure!
docker compose buildpodman build --platform linux/amd64 -t gunbot:latest .docker build --build-arg GUNBOT_VERSION=30.8.7 -t gunbot:30.8.7 .- Stop the container:
docker compose down - Rebuild with latest:
docker compose build --no-cache - Start:
docker compose up -d
Your configuration in data/ is preserved.
To run multiple Gunbot instances (e.g., different exchanges):
# docker-compose.yml
services:
gunbot-binance:
container_name: gunbot-binance
build: .
ports:
- "3001:3000"
volumes:
- ./data-binance:/data
environment:
- TZ=UTC
gunbot-kucoin:
container_name: gunbot-kucoin
build: .
ports:
- "3002:3000"
volumes:
- ./data-kucoin:/data
environment:
- TZ=UTCdocker compose logs -fdocker compose exec gunbot bashdocker compose psOn first run, Gunbot creates a default config.js. If you need to change the GUI port, edit data/config.js:
{
"ws": {
"port": 5001,
"clientport": 3000,
"hostname": "0.0.0.0"
},
"GUI": {
"enabled": true,
"port": 3000
}
}This Docker configuration is provided as-is. Gunbot requires a valid license from gunbot.com.
Inspired by: