Self-Hosted Setup

Deploy your own FiberWise instance with full control and customization. Perfect for teams, organizations, and production deployments.

🏗️

Setup Time: 15-30 minutes

Complete deployment with web interface and API access

🔧

Full Control

Your own instance with complete administrative access and customization

👥

Team Ready

Multi-user support with authentication and API key management

Installation Steps

1

Clone the FiberWise Core Repository

Get the FiberWise Core Web repository and navigate to the project:

# Clone the repository
git clone https://github.com/fiberwise-ai/fiberwise-core-web.git
cd fiberwise-core-web

# Verify you have the correct structure
ls -la
Note: This repository contains the complete FiberWise platform including the web interface, API backend, and all core functionality.
2

Environment Configuration

Set up your environment variables for production deployment:

# Copy the example environment file
cp .env.example .env

# Edit the configuration
nano .env  # or use your preferred editor

Production Configuration Variables:

# Database Configuration
DATABASE_URL=sqlite:///./fiberwise.db

# Security (IMPORTANT: Change these!)
SECRET_KEY=your-secure-secret-key-here
ALLOWED_HOSTS=localhost,127.0.0.1,yourdomain.com

# Storage Configuration
STORAGE_PROVIDER=local
LOCAL_STORAGE_PATH=./storage

# Server Settings
HOST=0.0.0.0
PORT=8000
ENVIRONMENT=production
DEBUG=false
LOG_LEVEL=info

# Optional: LLM Provider Configuration
# OPENAI_API_KEY=your-openai-key
# ANTHROPIC_API_KEY=your-anthropic-key
# GOOGLE_API_KEY=your-google-key
3

Install Backend Dependencies

Install Python dependencies for the platform:

# Create a virtual environment (recommended)
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install Python dependencies
pip install -r requirements.txt

# Create storage directory
mkdir -p storage

Backend Dependencies Installed:

✅ FastAPI - Web framework and API
✅ SQLAlchemy - Database ORM
✅ Pydantic - Data validation
✅ Uvicorn - ASGI server
✅ Authentication & Security libraries
✅ File handling & storage utilities
4

Install Frontend Dependencies

Set up the web interface and build the frontend assets:

# Install root dependencies
npm install

# Navigate to frontend directory and install
cd fiberwise_core
npm install

# Build the frontend for production
npm run build

# Return to root directory
cd ..

Frontend Build Complete:

✅ Vue.js - Frontend framework
✅ Vite - Build tool and dev server
✅ Component libraries
✅ Static assets compiled
✅ Production build ready
5

Initialize Database

Set up the database schema and create initial data:

# Initialize database with migrations
python -m alembic upgrade head

# Create initial admin user and organization
python scripts/init_admin.py

Database Setup Complete:

  • ✅ User management and authentication
  • ✅ API key system
  • ✅ Agent and function storage
  • ✅ Pipeline execution tracking
  • ✅ File upload and storage metadata
  • ✅ Activity and audit logging
6

Start the Platform

Launch your FiberWise instance:

🌐 Production Server

# Start the production server
python main.py

# Or use uvicorn directly
uvicorn main:app --host 0.0.0.0 --port 8000

This starts the complete platform with web interface and API.

🚀 Production Deployment

For production use with process management:

# Using systemd (recommended)
sudo systemctl start fiberwise
sudo systemctl enable fiberwise

# Or run in background with nohup
nohup python main.py > server.log 2>&1 &

# Check if server is running
curl http://localhost:8000/health
7

Access the Web Interface

Open your browser and complete the initial setup:

1. Open the Web Interface

Navigate to http://localhost:8000 (or your server's IP/domain)

2. Create Your Account

Follow the setup wizard to create your administrator account and organization

3. Generate API Key

After logging in, go to Settings → API Keys and generate your first API key

  1. Click on your profile menu in the top right
  2. Select "Settings" from the dropdown
  3. Navigate to "API Keys" in the settings sidebar
  4. Click "Generate New API Key"
  5. Give it a name (e.g., "CLI Access" or "Development")
  6. Copy and save the generated key securely
⚠️ Important: The API key will only be shown once. Make sure to copy and save it in a secure location.

🎉 Setup Complete!

  • ✅ Web interface accessible at http://localhost:8000
  • ✅ Administrator account created
  • ✅ API key generated for programmatic access
  • ✅ Ready for agent and application deployment
8

Configure CLI Connection

Connect your local FiberWise CLI to your self-hosted instance:

# Install FiberWise CLI (if not already installed)
pip install fiberwise

# Add your self-hosted instance configuration
fiber account add-config \
  --name "my-server" \
  --api-key "YOUR_API_KEY_FROM_STEP_7" \
  --base-url "http://localhost:8000" \
  --set-default

# Test the connection
fiber account list-configs

Verify CLI Connection:

# Test API connectivity
curl -H "Authorization: Bearer YOUR_API_KEY" \
     http://localhost:8000/api/v1/health

# List agents (should be empty initially)
fiber functions list --to-instance my-server

# You're ready to deploy agents and applications!

Self-Hosted Features

SQLite Database

Simple, reliable, and portable database - no setup required

Local File Storage

Store files directly on your server filesystem

Function Execution

Execute Python functions with input/output handling

REST API

Complete REST API for integration and automation

Web Interface

Built-in web UI for managing functions and data

API Authentication

Secure API access with API key authentication

Backup & Portability

� Easy Backup

Your entire Fiberwise instance is contained in just two locations:

# Backup your complete installation
tar -czf fiberwise-backup.tar.gz fiberwise.db storage/

# Restore on another server
tar -xzf fiberwise-backup.tar.gz

🚀 Quick Migration

Move your entire setup to a new server:

# Copy files to new server
scp fiberwise.db storage/ user@newserver:/path/to/fiberwise/
scp .env user@newserver:/path/to/fiberwise/

# Start on new server
python -m uvicorn main:app --host 0.0.0.0 --port 8080

� Version Control

Keep your data and configuration in sync:

# Backup script for regular snapshots
#!/bin/bash
DATE=$(date +%Y%m%d_%H%M%S)
cp fiberwise.db "backups/fiberwise_$DATE.db"
tar -czf "backups/storage_$DATE.tar.gz" storage/

Configuration Options

🔧 Basic Settings

# Environment variables in .env file
DEBUG=false
LOG_LEVEL=info
SECRET_KEY=your-secret-key-here
ALLOWED_HOSTS=localhost,127.0.0.1,yourdomain.com

🤖 LLM Providers

# Add LLM API keys to .env file
OPENAI_API_KEY=your-openai-key
ANTHROPIC_API_KEY=your-anthropic-key
GOOGLE_API_KEY=your-google-key

💾 Storage Path

# Configure storage location
LOCAL_STORAGE_PATH=./storage

# Or use absolute path
LOCAL_STORAGE_PATH=/home/user/fiberwise-storage

Security & Best Practices

File Permissions

Secure your database and storage files with proper permissions

API Key Security

Keep your API keys secure and rotate them regularly

Environment Variables

Use .env files for configuration, never commit secrets to git

Network Access

Use firewall rules to restrict access to your server

Regular Backups

Backup your database and storage files regularly

Monitoring & Maintenance

📊 Basic Monitoring

Monitor your instance with simple tools:

  • Check server logs for errors
  • Monitor disk space usage
  • Test API endpoints regularly
  • Backup database periodically

📝 Log Files

Check application logs:

# View recent logs
tail -f server.log

# Check for errors
grep ERROR server.log

🔔 Health Checks

Use the built-in health check:

# Simple health check
curl http://localhost:8080/health

# Check database connectivity
curl http://localhost:8080/api/functions

Platform Architecture

Fiberwise employs a modular, service-oriented architecture designed for scalability, security, and developer productivity.

🎯 Application Layer

Frontend
Fiberwise Core Web FastAPI + Web Components dashboard for comprehensive platform management
CLI Interface Python-based command-line tools for development and deployment automation
Custom Applications User-built apps with JavaScript SDK integration and real-time capabilities

⚡ Processing Layer

Runtime
Activation Processor Intelligent agent execution engine with dependency injection and lifecycle management
Worker System Distributed background processing with horizontal scaling and fault tolerance
Pipeline Orchestrator Multi-agent workflow coordination with conditional logic and error handling

🔧 Service Layer

APIs
LLM Provider Integration Multi-provider AI services (OpenAI, Anthropic, Ollama) with intelligent routing
OAuth & Credentials Secure external service integration with token management and refresh handling
Real-time Communication WebSocket-based live updates, streaming responses, and event broadcasting
Dynamic Data Layer Schema-flexible data storage with powerful querying and relationship management

🗄️ Infrastructure Layer

Foundation
Cross-Database Support SQLite, PostgreSQL, DuckDB, MySQL, MariaDB with automatic query adapter for "write once, run anywhere" SQL
Security & Authentication Multi-layer auth (sessions, API keys, agent keys) with CSRF protection and CORS handling
Storage & Assets Configurable storage backends (local, S3, Azure) for applications and static assets
Monitoring & Logging Health checks, performance metrics, execution tracking, and comprehensive error handling

Key Architectural Principles

🔄
Microservices Ready Loosely coupled services with clear interfaces and independent scaling
🛡️
Security First Zero-trust architecture with comprehensive authentication and authorization
📈
Horizontally Scalable Container-ready with distributed processing and load balancing capabilities
🔌
Extensible Plugin architecture with comprehensive APIs and SDK integration points

� Simple Usage Examples

Basic Function
# Simple function example
def main(input_data):
    name = input_data.get('name', 'World')
    return {
        'message': f'Hello, {name}!',
        'timestamp': str(datetime.now()),
        'status': 'success'
    }
Data Processing
# Process and store data
def main(input_data):
    items = input_data.get('items', [])
    processed = []
    
    for item in items:
        processed.append({
            'id': item['id'],
            'processed_at': str(datetime.now()),
            'result': item['value'] * 2
        })
    
    return {
        'processed_count': len(processed),
        'results': processed
    }

🔧 Basic Configuration

Environment Setup:
# Simple .env configuration
DATABASE_URL=sqlite:///./fiberwise.db
LOCAL_STORAGE_PATH=./storage
SECRET_KEY=your-secret-key-here
DEBUG=false
LOG_LEVEL=info
API Usage:
# Create and execute functions via API
curl -X POST http://localhost:8080/api/functions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "hello", "code": "def main(input_data): return {\"hello\": \"world\"}"}'

curl -X POST http://localhost:8080/api/functions/1/execute \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input_data": {"name": "Fiberwise"}}'

📈 Best Practices for Self-Hosting

File Management
  • Keep database and storage in the same directory
  • Create regular backups of fiberwise.db
  • Monitor disk space usage
  • Use symbolic links for large storage directories
Security
  • Set proper file permissions (600 for .env, 644 for db)
  • Use strong SECRET_KEY values
  • Keep API keys secure and rotate regularly
  • Use firewall rules to restrict network access
Maintenance
  • Monitor server logs for errors
  • Test API endpoints regularly
  • Keep application updated
  • Plan for data migration and scaling

Troubleshooting

🗃️ Database Issues

Database locked: Check if another process is using fiberwise.db
Database missing: Run python manage.py init_db to recreate
Permission denied: Check file permissions on fiberwise.db

💾 Storage Issues

Files not saving: Check storage directory permissions
Disk space full: Clean up old files or expand storage
Path not found: Verify LOCAL_STORAGE_PATH setting

🌐 Server Issues

Port already in use: Change port or stop conflicting service
Can't access from outside: Check firewall and host binding
API errors: Check API key and request format

Next Steps