Self-Hosted Quick Start
This guide will help you deploy Flexus on your own infrastructure using Docker Compose. In about 5 minutes, you’ll have a fully functional Flexus instance running locally.
Prerequisites
Before you begin, make sure you have:
- Docker (version 20.10 or later)
- Docker Compose (version 2.0 or later)
- Git for cloning the repository
- At least 4GB RAM available for Docker
- An LLM API key (OpenAI, Anthropic, or compatible provider)
Flexus is model-agnostic. You can use OpenAI, Anthropic, or any LiteLLM-compatible provider. You’ll configure this in the .env file.
Quick Start
-
Clone the Repository
Terminal window git clone https://github.com/smallcloudai/flexus.gitcd flexus -
Configure Environment
Copy the example environment file and edit it with your settings:
Terminal window cp .env.example .envOpen
.envand set the required variables:Terminal window # Required: Your LLM provider API keyLITELLM_API_KEY=sk-your-openai-key# Optional: Change default model (defaults to gpt-4o)LITELLM_MODEL=gpt-4o# Optional: Set a custom secret key for sessionsSESSION_SECRET=your-random-secret-here -
Start Flexus
Terminal window docker-compose up -dThis will start all required services:
- Frontend (Nuxt.js) on port 3000
- Backend (Python/GraphQL) on port 8000
- PostgreSQL database
- Redis for caching and pub/sub
- Background services (scheduler, advancer, etc.)
-
Open Flexus
Navigate to http://localhost:3000 in your browser.
-
Create Your Account
- Click “Sign Up” to create your first account
- This account will automatically become the admin
- Create your first workspace
Verify Installation
After starting, verify all services are running:
docker-compose psYou should see all services in “Up” state:
NAME STATUSflexus-frontend Upflexus-backend Upflexus-postgres Upflexus-redis Upflexus-advancer Upflexus-scheduler UpCheck logs if something isn’t working:
# All servicesdocker-compose logs -f
# Specific servicedocker-compose logs -f backendYour First Bot
Once logged in, let’s hire your first bot:
-
Navigate to Marketplace
Click “Marketplace” in the sidebar to see available bots.
-
Hire Frog Bot
Find “Frog” — it’s a simple demo bot designed for learning. Click “Hire” to add it to your workspace.
-
Configure the Bot
After hiring, you’ll see the bot’s setup dialog. For Frog, the defaults work fine. Click “Save”.
-
Start a Conversation
Click on the Frog bot in your sidebar and send a message:
Hello! Can you ribbit for me? -
Watch It Work
The bot will respond using its tools. You can see the Kanban board showing task progress.
You now have a working Flexus installation. Explore the marketplace to find more bots, or continue to learn how to build your own.
Configuration Options
Database
By default, Flexus uses a PostgreSQL container. For production, you may want to use an external database:
DATABASE_URL=postgresql://user:password@your-db-host:5432/flexusRedis
Similarly, you can configure an external Redis:
REDIS_URL=redis://your-redis-host:6379LLM Providers
Flexus uses LiteLLM for model routing. You can configure multiple providers:
# OpenAILITELLM_API_KEY=sk-...LITELLM_MODEL=gpt-4o
# Or AnthropicLITELLM_API_KEY=sk-ant-...LITELLM_MODEL=claude-3-5-sonnet-20241022
# Or Azure OpenAIAZURE_API_KEY=...AZURE_API_BASE=https://your-resource.openai.azure.com/LITELLM_MODEL=azure/gpt-4oStorage
Configure object storage for file uploads:
# Local storage (default)STORAGE_TYPE=localSTORAGE_PATH=/data/uploads
# Or S3-compatibleSTORAGE_TYPE=s3AWS_ACCESS_KEY_ID=...AWS_SECRET_ACCESS_KEY=...S3_BUCKET=flexus-uploadsUpdating Flexus
To update to the latest version:
# Pull latest imagesdocker-compose pull
# Restart with new imagesdocker-compose up -d
# Run database migrationsdocker-compose exec backend python -m prisma migrate deployStopping Flexus
# Stop all servicesdocker-compose down
# Stop and remove volumes (WARNING: deletes all data)docker-compose down -vTroubleshooting
Services Won’t Start
Check if ports are already in use:
# Check port 3000lsof -i :3000
# Check port 8000lsof -i :8000Database Connection Errors
Ensure PostgreSQL is fully started before backend:
docker-compose logs postgresBot Not Responding
Check the advancer service logs:
docker-compose logs advancerVerify your LLM API key is correct:
docker-compose exec backend python -c "import os; print(os.environ.get('LITELLM_API_KEY', 'NOT SET')[:10] + '...')"Next Steps
- Understand How Bots Work — Learn about Personas and Experts
- Build Your First Bot — Create a custom agent
- Production Deployment — Deploy on Kubernetes for production
Production Considerations
For production deployments, consider:
- Use external databases — PostgreSQL and Redis with proper backups
- Configure HTTPS — Set up a reverse proxy (nginx, Traefik) with TLS
- Set up monitoring — Prometheus metrics are exposed on
/metrics - Configure log aggregation — Services log to stdout in JSON format
- Scale horizontally — Use Kubernetes for multi-node deployments
See the Kubernetes Deployment Guide for production-ready setup.