Skip to content

Installation & Setup

Get Flexus up and running for your organization with this comprehensive installation guide.

The fastest way to get started is with Flexus Cloud, our hosted solution.

1. Create Your Account

  1. Visit flexus.ai
  2. Click β€œStart Free Trial”
  3. Complete the registration form
  4. Verify your email address
  5. 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:

Terminal window
# DNS Configuration (if using custom domain)
CNAME flexus.yourcompany.com -> app.flexus.ai
TXT _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
  • 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

Terminal window
# Clone the repository
git clone https://github.com/flexus-platform/flexus.git
cd flexus
# Or download release
wget https://github.com/flexus-platform/flexus/releases/latest/download/flexus-linux.tar.gz
tar -xzf flexus-linux.tar.gz
cd 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

Terminal window
# Run database migrations
docker-compose exec flexus-backend python manage.py migrate
# Create initial superuser
docker-compose exec flexus-backend python manage.py createsuperuser
# Load initial data
docker-compose exec flexus-backend python manage.py loaddata initial_data.json

4. 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

Terminal window
# Check all services are running
docker-compose ps
# Test API health
curl https://flexus.yourcompany.com/api/health
# Check logs
docker-compose logs -f flexus-backend

2. Admin Configuration

  1. Access the admin interface at https://flexus.yourcompany.com/admin
  2. Log in with the superuser account
  3. 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.

Terminal window
# Install monitoring tools
docker-compose -f docker-compose.monitoring.yml up -d
# Includes:
# - Prometheus (metrics collection)
# - Grafana (visualization)
# - AlertManager (alerting)

Log Management

Terminal window
# Configure log rotation
sudo 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

Terminal window
# Check database is running
docker-compose exec postgres pg_isready
# Check credentials
docker-compose exec postgres psql -U flexus_user -d flexus_production -c "SELECT 1;"

Redis Connection Issues

Terminal window
# Test Redis connection
docker-compose exec redis redis-cli ping
# Check Redis logs
docker-compose logs redis

SSL Certificate Issues

Terminal window
# Test SSL certificate
openssl s_client -connect flexus.yourcompany.com:443
# Check certificate expiry
certbot certificates
Info

For detailed troubleshooting guides, see our Troubleshooting Section.

Next Steps

After successful installation:

  1. Configure your first workspace
  2. Set up groups and invite users
  3. Create your first bot
  4. Explore integrations

Need Help? Contact our support team or check the FAQ for common questions.