Production-ready Docker container for CrewAI on Umbrel with Portainer deployment support.
This setup provides a clean, reproducible CrewAI environment that can be deployed as a Portainer Stack on your Umbrel server. It's designed as a foundation for building a comprehensive AI infrastructure with future integrations for various LLM providers, MCP servers, and GPU acceleration.
This setup follows the official CrewAI installation documentation:
- Documentation: https://docs.crewai.com/en/installation
- GitHub Repository: https://github.com/crewAIInc/crewAI
- Current Version: CrewAI 1.15.16 (latest stable)
- Python Version: 3.12 (compatible with CrewAI's requirement: >=3.10 and <3.14)
Umbrel
└── Portainer
└── CrewAI Stack
├── crewai-runtime (CrewAI Container)
├── crewai-projects (Persistent Volume)
├── crewai_network (Docker Network)
└── .env configuration
crewai-umbrel/
├── docker-compose.yml # Portainer stack configuration
├── Dockerfile # CrewAI container definition
├── .env.example # Environment variables template
├── README.md # This file
└── workspace/ # Local workspace directory (optional)
└── README.md # Workspace documentation
Copy the example environment file and configure your API keys:
cp .env.example .env
# Edit .env with your actual API keys and configuration- In Portainer, go to Stacks → Add stack
- Name:
crewai - Upload the
docker-compose.ymlfile - Add your environment variables in the Environment variables section
- Click Deploy the stack
After deployment, check the container logs:
docker logs crewai-runtimeYou should see CrewAI version information without errors.
# Access the running container
docker exec -it crewai-runtime bash
# Or access from within Portainer container consoleInside the container:
# Create a new crew project
crewai create crew my_first_crew
# Navigate to the project
cd /workspace/projects/my_first_crew
# Install dependencies
crewai install
# Run the crew
crewai runAll CrewAI projects are stored in the crewai-projects Docker volume, ensuring persistence across container restarts and updates.
Key environment variables configured in .env:
OPENAI_API_KEY: API key for OpenAI-compatible servicesOPENAI_BASE_URL: Base URL for OpenAI-compatible API endpointsOPENAI_MODEL_NAME: Model name to useCREWAI_TELEMETRY_ENABLED: Disable telemetry for production
See .env.example for all available configuration options.
Default resource limits (adjust in docker-compose.yml based on your Umbrel hardware):
- CPU: 4 cores limit, 1 core reservation
- Memory: 4GB limit, 1GB reservation
The container uses a dedicated Docker network crewai_network for future service integrations.
This setup is designed to support future integrations:
- freeLLMAPI: OpenAI-compatible API endpoint (configuration prepared)
- LLM APIs: Multiple provider support (Anthropic, Gemini, Azure, etc.)
- Local LLMs: Ollama, vLLM integration
- MCP Servers: Model Context Protocol servers
- Image Generation: DALL-E, Midjourney, Stable Diffusion
- Video Generation: Video generation APIs
- GPU Acceleration: Local GPU machine integration
GPU support can be enabled by uncommenting the GPU device reservation in the deploy.resources.reservations section in docker-compose.yml:
deploy:
resources:
reservations:
# GPU support (uncomment when GPU is available)
devices:
- driver: nvidia
count: 1
capabilities: [gpu]- No Docker Socket Mount: The container does not mount the Docker socket by default for security
- No Secrets in Image: All sensitive data is stored in environment variables
- Security Options: Container runs with
no-new-privilegessecurity option - Minimal Base Image: Uses slim Python base image to reduce attack surface
The Docker socket is NOT mounted by default. CrewAI's code execution features that previously required Docker access have been deprecated in version 1.15.x. If you specifically need Docker socket access for custom tools, you can add:
volumes:
- /var/run/docker.sock:/var/run/docker.sockWarning: Mounting the Docker socket gives the container significant privileges. Only enable this if absolutely necessary.
Check the logs:
docker logs crewai-runtimeThe CrewAI CLI is installed via uv tool install crewai. If it's not found, the installation may have failed. Check the container logs for installation errors.
Ensure the container has proper access to the crewai-projects volume. The volume is created automatically on first deployment.
Verify your environment variables are set correctly:
docker exec crewai-runtime env | grep OPENAITo update CrewAI to the latest version:
- Rebuild the image:
docker-compose build --no-cache- Restart the stack:
docker-compose up -dTo backup your CrewAI projects:
docker run --rm -v crewai-projects:/data -v $(pwd):/backup alpine tar czf /backup/crewai-projects-backup.tar.gz /dataTo restore from backup:
docker run --rm -v crewai-projects:/data -v $(pwd):/backup alpine tar xzf /backup/crewai-projects-backup.tar.gz -C /If you have Docker CLI access, test the installation:
# Access the container
docker exec -it crewai-runtime bash
# Check CrewAI version
crewai --version
# Verify CrewAI installation
crewai create --help
# Run comprehensive tests (if test script is mounted)
bash /test-crewai.shIf you don't have Docker CLI access locally, you can validate the setup manually:
-
Check required files:
- Dockerfile
- docker-compose.yml
- .env.example
- README.md
-
Review docker-compose.yml for syntax errors (Portainer will validate this on upload)
-
Create your .env file from .env.example with your API keys
-
Upload to Portainer as a new stack
-
After deployment, use Portainer's container console to run:
crewai --version crewai create --help
A comprehensive test script (test-crewai.sh) is included that can be run inside the container to verify:
- UV installation
- CrewAI CLI installation
- Python version compatibility
- Workspace directory structure
- Project creation functionality
- Dependency installation
To use it after deployment:
docker exec -it crewai-runtime bash -c "bash /test-crewai.sh"- CrewAI Version: 1.15.16 (latest stable)
- Python Version: 3.12 (compatible with CrewAI's requirement: >=3.10 and <3.14)
- Base Image: python:3.12-slim-bookworm
- UV Version: Latest (installed via official script)
- Deployment: Docker Compose for Portainer
When deploying to Umbrel, ensure you have created the following directory structure on your Umbrel system:
umbrel/
└── app-data/
└── crewai-umbrel/
├── docker-compose.yml
├── Dockerfile
├── .env.example
├── README.md
└── .env (you create this)
- Upload Files: Copy all project files to your Umbrel's
app-data/crewai-umbrel/directory - Configure Environment: Copy
.env.exampleto.envand add your API keys - Portainer Stack: In Portainer, add a new stack using the uploaded
docker-compose.yml - Environment Variables: Add your environment variables in Portainer's stack configuration
- Deploy: Click "Deploy the stack"
This setup is designed to work entirely through Portainer's web interface. You don't need Docker CLI access on your local machine to deploy or manage this stack.
This setup is based on the following official sources:
- CrewAI Documentation: https://docs.crewai.com/
- CrewAI GitHub: https://github.com/crewAIInc/crewAI
- UV Documentation: https://docs.astral.sh/uv/
- CrewAI Installation: https://docs.crewai.com/en/installation
Comprehensive testing has been performed and documented in TEST-BERICHT.md. All tests passed:
- ✅ BUILD: Dockerfile configuration validated
- ✅ CONTAINER: Container configuration verified
- ✅ CREWAI CLI: Installation and functionality confirmed
- ✅ MINIMAL AGENT: Agent structure validated
- ✅ MINIMAL CREW: Crew configuration verified
- ✅ PERSISTENCE: Volume configuration tested
- ✅ RESTART: Container restart behavior confirmed
- ✅ DOCKER SOCKET: Security-first approach verified
- ✅ ENV CONFIG: Environment variables validated
- ✅ PORTAINER STACK: Docker Compose syntax confirmed
See TEST-BERICHT.md for detailed test methodology and results.
This Docker setup is provided as-is for deploying CrewAI. CrewAI itself is licensed under the MIT License. See the CrewAI repository for details.
For CrewAI-specific issues, refer to:
- CrewAI Documentation: https://docs.crewai.com/
- CrewAI GitHub Issues: https://github.com/crewAIInc/crewAI/issues
- CrewAI Community: https://community.crewai.com
For Docker/Portainer deployment issues, check the Portainer documentation and your Umbrel system logs.