Overview
This guide walks you through self-hosting the Hive agent framework on your own infrastructure. You’ll learn how to install dependencies, configure the environment, and run agents locally or on a server.Prerequisites
- Python 3.11+ - Required for the core framework
- Node.js 20+ - Required for the web dashboard (optional)
- uv - Fast Python package installer (installed automatically by quickstart)
Quick Start
The easiest way to get started is with the interactive quickstart script:Run Quickstart
- Verify Python 3.11+ installation
- Install
uvpackage manager if missing - Install workspace packages (core + tools)
- Install Playwright browser for web scraping
- Configure your LLM provider
- Initialize the credential store
- Build the frontend dashboard
- Install the
hiveCLI globally
Manual Installation
If you prefer manual setup, follow these steps:1. Install Python Dependencies
2. Configure LLM Provider
Set your API key as an environment variable:~/.hive/configuration.json:
3. Initialize Credential Store
Generate an encryption key for the credential store:~/.hive/credentials/.
4. Build Frontend (Optional)
If you want the web dashboard:5. Install CLI
Make thehive CLI globally accessible:
Directory Structure
After installation, your Hive installation will have this structure:Running Agents
CLI Interface
Run an agent from the command line:TUI Dashboard
Launch the interactive terminal dashboard:- Browse available agents
- Start/stop agent execution
- View real-time logs
- Monitor token usage
Web Dashboard
Start the web server:http://localhost:8787.
Environment Variables
Required
Fernet encryption key for credential storage. Generate with:
Optional
Anthropic API key for Claude models
OpenAI API key for GPT models
Google Gemini API key
Brave Search API key for web search tools
Custom storage path for agent data. Defaults to
~/.hive/agents/{agent-name}Agent name for storage paths. Set automatically by AgentRunner.
Docker Deployment
Dockerfile
Create a Dockerfile for containerized deployment:Docker Compose
Production Considerations
Security
Credential Storage
Credential Storage
- Store
HIVE_CREDENTIAL_KEYin a secrets manager (AWS Secrets Manager, HashiCorp Vault) - Never commit credential files to version control
- Use encrypted volumes for
~/.hive/credentials/ - Rotate encryption keys periodically
API Keys
API Keys
- Use environment variables, never hardcode
- Implement rate limiting for API calls
- Monitor API usage and set alerts
- Use separate keys for dev/staging/prod
Network
Network
- Run dashboard behind a reverse proxy (nginx, Caddy)
- Enable HTTPS with valid certificates
- Implement authentication for web access
- Use firewall rules to restrict access
Performance
- LLM Caching: Enable prompt caching for providers that support it (Anthropic Claude)
- Browser Sessions: Reuse browser contexts instead of launching new browsers
- Concurrent Agents: Use async execution for multiple agents
- Resource Limits: Set memory/CPU limits in Docker
Monitoring
Troubleshooting
Common Issues
Python Version Error
Python Version Error
Error:
Python 3.11+ is requiredSolution: Install Python 3.11 or newer:Playwright Installation Fails
Playwright Installation Fails
Error:
playwright install chromium failedSolution: Install system dependencies:Credential Decryption Error
Credential Decryption Error
Error:
Failed to decrypt credentialSolution: Verify HIVE_CREDENTIAL_KEY is set correctly:Port Already in Use
Port Already in Use
Error:
Address already in use: 8787Solution: Use a different port:Next Steps
Credential Management
Learn how to securely store and manage API credentials
LLM Providers
Configure different LLM providers and models
MCP Integration
Connect external MCP servers for tool access
Browser Automation
Enable browser control for web automation tasks