This document provides detailed information about running Flujo in a Docker container.
Flujo can be run in a Docker container, which provides several benefits:
- Consistent environment across different platforms
- Isolation from the host system
- Easy deployment
- Support for running Docker-based MCP servers within Flujo
- Docker installed on your system
- Docker Compose (optional, but recommended)
-
Clone the repository:
git clone https://github.com/mario-andreschak/FLUJO.git cd FLUJO -
Build and start the container:
docker-compose up -d
-
Access Flujo in your browser:
http://localhost:4200
For more control over the Docker build and run process, you can use the provided scripts:
-
Build the Docker image:
./scripts/build-docker.sh
Options:
--verbose: Show build output in the terminal--tag=<tag>: Specify a custom tag for the image (default: latest)
-
Run the Docker container:
./scripts/run-docker.sh
Options:
--detached: Run in detached mode--no-privileged: Run without privileged mode (not recommended)--port=<port>: Specify the host port (default: 4200)--tag=<tag>: Specify the image tag to run (default: latest)
Flujo's Docker container includes Docker-in-Docker (DinD) support, which allows you to run Docker-based MCP servers within the Flujo container. This is achieved by running the Docker daemon inside the container.
- The Docker container is started with the
--privilegedflag, which is required for Docker-in-Docker. - The Docker daemon is started inside the container when it launches.
- Flujo can then use this Docker daemon to run Docker-based MCP servers.
Running containers in privileged mode has security implications. The container has full access to the host system, which could be a security risk. Use this feature only in trusted environments.
Flujo uses a Docker volume to persist data between container restarts. By default, this volume is mounted at /app/data inside the container.
The data that is persisted includes:
- MCP server configurations
- Model configurations
- Flow definitions
- Environment variables and API keys
You can customize the Flujo container by setting environment variables in the docker-compose.yml file:
services:
flujo:
environment:
- NODE_ENV=production
# Add your custom environment variables hereYou can add additional volume mounts in the docker-compose.yml file:
services:
flujo:
volumes:
- flujo-data:/app/data # Default volume for persistent storage
# Add your custom volumes hereIf the container fails to start, check the logs:
docker logs flujoCommon issues:
- Port 4200 is already in use: Change the port mapping in
docker-compose.ymlor use the--portoption withrun-docker.sh. - Insufficient permissions: Make sure you're running Docker with appropriate permissions.
If you can't connect to Flujo in your browser:
- Check if the container is running:
docker ps | grep flujo - Check the logs for any errors:
docker logs flujo - Make sure you're using the correct port: By default, Flujo is accessible at
http://localhost:4200
You can build custom Flujo Docker images by modifying the Dockerfile. The Dockerfile uses a multi-stage build process:
- Prepare Stage: Prepares the package.json for Docker by removing Electron-related dependencies.
- Build Stage: Builds the Next.js application.
- Runtime Stage: Sets up the Docker-in-Docker environment and runs the application.
To build a custom image:
- Modify the Dockerfile as needed.
- Build the image:
docker build -t flujo:custom . - Run the custom image:
docker run -d --privileged -p 4200:4200 -v flujo-data:/app/data --name flujo flujo:custom