Installation & Setup
Get Flexus up and running for your organization with this comprehensive installation guide.
Cloud Setup (Recommended)
The fastest way to get started is with Flexus Cloud, our hosted solution.
1. Create Your Account
- Visit flexus.ai
- Click βStart Free Trialβ
- Complete the registration form
- Verify your email address
- Set up your organization profile
2. Initial Configuration
# Organization Setup Checklist
β‘ Workspace name and description
β‘ Primary domain (for email invitations)
β‘ Time zone and locale
β‘ Initial admin user setup
β‘ Billing information (for paid plans) # Generate API keys for integrations
curl -X POST "https://api.flexus.ai/v1/auth/api-keys" \
-H "Authorization: Bearer YOUR_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"key_name": "Integration Key",
"permissions": ["read", "write"],
"expires_in": "1y"
}' 3. Domain Configuration
For custom domains and SSO integration:
# DNS Configuration (if using custom domain)CNAME flexus.yourcompany.com -> app.flexus.aiTXT _flexus-verification -> your-verification-token Tip
Cloud setup includes automatic updates, backups, and 99.9% uptime SLA. Perfect for most organizations.
On-Premise Installation
For organizations requiring full control over data and infrastructure.
System Requirements
Minimum Requirements
- CPU: 4 cores
- RAM: 8 GB
- Storage: 50 GB SSD
- OS: Ubuntu 20.04+ / CentOS 8+ / Docker-compatible
Recommended Requirements
- CPU: 8+ cores
- RAM: 16+ GB
- Storage: 200+ GB SSD
- Network: 1 Gbps
- OS: Ubuntu 22.04 LTS
Prerequisites
# Install Docker and Docker Compose
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
# Install Docker Compose
sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
# Add user to docker group
sudo usermod -aG docker $USER # PostgreSQL installation
sudo apt update
sudo apt install postgresql postgresql-contrib
# Create Flexus database
sudo -u postgres createdb flexus_production
sudo -u postgres createuser flexus_user
sudo -u postgres psql -c "ALTER USER flexus_user WITH PASSWORD 'secure_password';"
sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE flexus_production TO flexus_user;" Installation Steps
1. Download Flexus
# Clone the repositorygit clone https://github.com/flexus-platform/flexus.gitcd flexus
# Or download releasewget https://github.com/flexus-platform/flexus/releases/latest/download/flexus-linux.tar.gztar -xzf flexus-linux.tar.gzcd flexus/2. Environment Configuration
# Copy example environment file
cp .env.example .env
# Edit configuration
nano .env
# Key settings to configure:
DATABASE_URL="postgresql://flexus_user:secure_password@localhost:5432/flexus_production"
REDIS_URL="redis://localhost:6379"
SECRET_KEY="your-super-secure-secret-key"
FLEXUS_HOST="https://flexus.yourcompany.com"
SMTP_HOST="smtp.yourcompany.com"
SMTP_USER="noreply@yourcompany.com"
SMTP_PASSWORD="your-smtp-password" # docker-compose.yml for production
version: '3.8'
services:
flexus-backend:
image: flexus/backend:latest
environment:
- DATABASE_URL=${DATABASE_URL}
- REDIS_URL=${REDIS_URL}
depends_on:
- postgres
- redis
ports:
- "8000:8000"
flexus-frontend:
image: flexus/frontend:latest
environment:
- NUXT_PUBLIC_API_URL=http://flexus-backend:8000
ports:
- "3000:3000"
depends_on:
- flexus-backend
postgres:
image: postgres:15
environment:
POSTGRES_DB: flexus_production
POSTGRES_USER: flexus_user
POSTGRES_PASSWORD: secure_password
volumes:
- postgres_data:/var/lib/postgresql/data
redis:
image: redis:7-alpine
volumes:
- redis_data:/data
volumes:
postgres_data:
redis_data: 3. Database Migration
# Run database migrationsdocker-compose exec flexus-backend python manage.py migrate
# Create initial superuserdocker-compose exec flexus-backend python manage.py createsuperuser
# Load initial datadocker-compose exec flexus-backend python manage.py loaddata initial_data.json4. SSL Configuration
# Install certbot
sudo apt install certbot python3-certbot-nginx
# Generate SSL certificate
sudo certbot --nginx -d flexus.yourcompany.com
# Auto-renewal
sudo crontab -e
# Add: 0 12 * * * /usr/bin/certbot renew --quiet # /etc/nginx/sites-available/flexus
server {
listen 443 ssl http2;
server_name flexus.yourcompany.com;
ssl_certificate /etc/letsencrypt/live/flexus.yourcompany.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/flexus.yourcompany.com/privkey.pem;
# Frontend
location / {
proxy_pass http://localhost:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
# Backend API
location /api/ {
proxy_pass http://localhost:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
# WebSocket support
location /ws/ {
proxy_pass http://localhost:8000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
} Post-Installation Setup
1. Health Check
# Check all services are runningdocker-compose ps
# Test API healthcurl https://flexus.yourcompany.com/api/health
# Check logsdocker-compose logs -f flexus-backend2. Admin Configuration
- Access the admin interface at
https://flexus.yourcompany.com/admin - Log in with the superuser account
- Configure:
- Email settings
- Authentication providers
- Default permissions
- System limits
3. Backup Setup
#!/bin/bash
# backup-flexus.sh
DATE=$(date +%Y%m%d_%H%M%S)
BACKUP_DIR="/backups/flexus"
# Create backup directory
mkdir -p $BACKUP_DIR
# Backup PostgreSQL
docker-compose exec -T postgres pg_dump -U flexus_user flexus_production > $BACKUP_DIR/db_$DATE.sql
# Backup uploaded files
tar -czf $BACKUP_DIR/files_$DATE.tar.gz -C /var/lib/flexus uploads/
# Cleanup old backups (keep 30 days)
find $BACKUP_DIR -name "*.sql" -mtime +30 -delete
find $BACKUP_DIR -name "*.tar.gz" -mtime +30 -delete # Add to crontab
crontab -e
# Daily backup at 2 AM
0 2 * * * /opt/flexus/scripts/backup-flexus.sh
# Weekly full backup
0 3 * * 0 /opt/flexus/scripts/full-backup.sh Monitoring & Maintenance
System Monitoring
Warning
Set up monitoring before going to production. Monitor CPU, memory, disk space, and application metrics.
# Install monitoring toolsdocker-compose -f docker-compose.monitoring.yml up -d
# Includes:# - Prometheus (metrics collection)# - Grafana (visualization)# - AlertManager (alerting)Log Management
# Configure log rotationsudo nano /etc/logrotate.d/flexus
# Log rotation configuration/var/log/flexus/*.log { daily missingok rotate 30 compress delaycompress notifempty sharedscripts}Updates
# Update Flexus
docker-compose pull
docker-compose down
docker-compose up -d
# Run migrations if needed
docker-compose exec flexus-backend python manage.py migrate # Blue-green deployment script
./scripts/deploy.sh --environment=production --strategy=blue-green
# Rolling updates with health checks
./scripts/rolling-update.sh --max-unavailable=1 Troubleshooting
Common Issues
Database Connection Failed
# Check database is runningdocker-compose exec postgres pg_isready
# Check credentialsdocker-compose exec postgres psql -U flexus_user -d flexus_production -c "SELECT 1;"Redis Connection Issues
# Test Redis connectiondocker-compose exec redis redis-cli ping
# Check Redis logsdocker-compose logs redisSSL Certificate Issues
# Test SSL certificateopenssl s_client -connect flexus.yourcompany.com:443
# Check certificate expirycertbot certificates Info
For detailed troubleshooting guides, see our Troubleshooting Section.
Next Steps
After successful installation:
- Configure your first workspace
- Set up groups and invite users
- Create your first bot
- Explore integrations
Need Help? Contact our support team or check the FAQ for common questions.