Hummingbot API Installation¶
The central hub for running Hummingbot trading bots - now with AI assistant integration via MCP (Model Context Protocol).
The Hummingbot API provides a comprehensive trading platform with three ways to interact:
- π€ MCP (AI Assistant) - Control your trading with Claude, ChatGPT, or Gemini using natural language
- π Dashboard - Visual web interface for bot management and monitoring
- π§ Swagger UI - Full REST API access for developers and power users
Prerequisites¶
- Docker and Docker Compose installed
- Git for cloning the repository
- Python 3.10+ and Conda (for source installation only)
- Exchange API keys (can be added after installation)
Quick Start (Docker - Recommended)¶
Use this when you are deploying Hummingbot API on its own machine (for example a VPS or another remote server), or any time you only need the API and database stack and not Condor. Docker must be installed and running on that server before you run the command:
curl -fsSL https://raw.githubusercontent.com/hummingbot/deploy/main/setup.sh | bash -s -- --hummingbot-api
The installer clones the hummingbot-api repository (next to where you ran the command), runs make setup, pulls the latest images, and runs make deploy. That starts all Docker services for youβthe API, PostgreSQL, and EMQX (MQTT broker)βso you normally do not need to start containers by hand.
The setup script may prompt you for:
Credentials (required):
- API username and password (HTTP Basic Auth for the REST API)
- Config password (used to encrypt bot credentials at rest)
If the script finishes but something did not come up (for example Docker was not running, or a step failed), open a terminal, go into the API folder the script created, and run:
That applies your .env again and brings the full stack up with Docker Compose.
The API will be accessible at http://localhost:8000.
Verify Installation¶
Once installed, you can verify the API is running:
Check API health¶
Access API documentation¶
Open your browser and navigate to:
- Interactive API docs:
http://localhost:8000/docs - Alternative API docs:
http://localhost:8000/redoc
Configuration¶
The installer creates a .env file inside hummingbot-api/. Edit it, then run make deploy again so containers pick up changes.
Common variables (see config.py in the hummingbot-api repo for the full list and nested settings):
USERNAME/PASSWORDβ HTTP Basic Auth for the REST APICONFIG_PASSWORDβ encrypts bot credential files at restDATABASE_URLβ PostgreSQL connection string. When the API runs inside Docker,docker-compose.ymloverrides this to use the Compose service hostnamepostgres(not the container namehummingbot-postgres). Formake runon your host against Compose-backed Postgres, uselocalhostin.env.BROKER_*β EMQX / MQTT. Compose overridesBROKER_HOSTtoemqxfor the API container; keeplocalhostin.envfor local dev withmake run.GATEWAY_URLβ Hummingbot Gateway (defaulthttp://localhost:15888).DEBUG_MODEβ set totrueonly for local development to disable API Basic Auth (never in production).
Optional tuning (market-data intervals, Logfire, AWS, etc.) maps to nested settings in config.py (for example MARKET_DATA_*). Prefer defaults unless you have a specific need.
Troubleshooting¶
Database (PostgreSQL)¶
- Check services (from
hummingbot-api/):
- Connect with the right user β the image creates user
hbotand databasehummingbot_api(POSTGRES_USER/POSTGRES_DBindocker-compose.yml). Use:
If you run docker exec ... psql without -U hbot, PostgreSQL may try the postgres role and you can see role "postgres" does not exist β that is expected; always pass -U hbot.
- Full reset (β οΈ deletes Postgres volume data):
Recreate .env with make setup first if you need new credentials.
There is no fix-database.sh in the current hummingbot-api tree; use the commands above.
EMQX (MQTT broker)¶
Service emqx, container name hummingbot-broker:
Dashboard: http://localhost:18083 (default login is often admin / public β confirm in EMQX docs).
Port 8000 already in use¶
Docker: in docker-compose.yml, change the published port for hummingbot-api, e.g.:
make run (dev): this repo does not ship a run.sh. The Makefile run target starts Postgres + EMQX then runs uvicorn main:app --reload. To use another port, add --port 8001 to that uvicorn line or run Uvicorn yourself after docker compose up emqx postgres -d.
Common issues¶
| Symptom | What to try |
|---|---|
| API or DB errors | docker compose ps and docker compose logs for hummingbot-api and postgres |
| Broker / bots cannot connect | docker compose restart emqx; check hummingbot-broker logs |
Cannot open http://localhost:8000 |
docker ps and confirm hummingbot-api is running |
| HTTP auth fails | Match USERNAME / PASSWORD in .env to what clients send |
| Stale or corrupt data | docker compose down -v then make deploy (β οΈ wipes DB volume) |
Development (make install / make run)¶
Support & documentation¶
- Interactive API docs: http://localhost:8000/docs when the stack is running
- Repository README: hummingbot-api
- Issues: github.com/hummingbot/hummingbot-api/issues
Next Steps¶
After installation, proceed to the Developer Guide to learn how to:
- Add exchange credentials
- View your portfolio
- Place your first order