This guide provides step-by-step instructions for installing LinX (灵枢) on Linux, macOS, and Windows.
- System Requirements
- Linux Installation
- macOS Installation
- Windows Installation
- Post-Installation Setup
- Verification
- Troubleshooting
- CPU: 4 cores
- RAM: 8GB
- Storage: 50GB free space
- OS:
- Linux: Ubuntu 20.04+, Debian 11+, CentOS 8+, RHEL 8+, Fedora 35+
- macOS: 12.0 (Monterey) or later
- Windows: Windows 10/11 with WSL 2
- CPU: 8+ cores
- RAM: 16GB+
- Storage: 100GB+ SSD
- Network: Stable internet connection
- Python: 3.11 or later
- Node.js: 20.x or later (for frontend development)
- Docker: 24.0 or later
- Docker Compose: 2.20 or later
We provide an automated setup script for Linux:
# Download the repository
git clone https://github.com/asmoyou/LinX.git
cd LinX
# Run the setup script
chmod +x infrastructure/scripts/setup-linux.sh
./infrastructure/scripts/setup-linux.shThe script will:
- Install Docker and Docker Compose
- Install gVisor (for enhanced security)
- Install Firecracker (if KVM is available)
- Install Python 3.11+ and dependencies
- Configure user permissions
Ubuntu/Debian:
# Update package index
sudo apt-get update
# Install dependencies
sudo apt-get install -y ca-certificates curl gnupg lsb-release
# Add Docker's official GPG key
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
# Set up repository
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
# Install Docker Engine
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
# Add user to docker group
sudo usermod -aG docker $USERCentOS/RHEL/Fedora:
# Install Docker
sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
# Start Docker
sudo systemctl start docker
sudo systemctl enable docker
# Add user to docker group
sudo usermod -aG docker $USERUbuntu/Debian:
sudo apt-get install -y python3.11 python3.11-venv python3-pipCentOS/RHEL/Fedora:
sudo yum install -y python3.11 python3-pip# Download runsc
ARCH=$(uname -m)
URL=https://storage.googleapis.com/gvisor/releases/release/latest/${ARCH}
wget ${URL}/runsc ${URL}/runsc.sha512
# Verify and install
sha512sum -c runsc.sha512
sudo mv runsc /usr/local/bin/
sudo chmod +x /usr/local/bin/runsc
# Configure Docker to use gVisor
sudo tee /etc/docker/daemon.json > /dev/null <<EOF
{
"runtimes": {
"runsc": {
"path": "/usr/local/bin/runsc"
}
}
}
EOF
# Restart Docker
sudo systemctl restart docker# Clone repository
git clone https://github.com/asmoyou/LinX.git
cd LinX
# Create Python virtual environment
cd backend
python3.11 -m venv venv
source venv/bin/activate
# Install Python dependencies
pip install -r requirements.txt
# Configure environment
cd ..
cp .env.example .env
# Edit .env with your configuration
nano .env# Start infrastructure services
docker compose up -d
# Wait for services to be ready
sleep 30
# Run database migrations
cd backend
source venv/bin/activate
alembic upgrade head# Download the repository
git clone https://github.com/asmoyou/LinX.git
cd LinX
# Run the setup script
chmod +x infrastructure/scripts/setup-macos.sh
./infrastructure/scripts/setup-macos.shThe script will:
- Install Homebrew (if not installed)
- Install Docker Desktop
- Install Python 3.11+
- Install PostgreSQL and Redis clients
- Install Python dependencies
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"brew install --cask dockerStart Docker Desktop from Applications folder.
brew install python@3.11
brew link python@3.11brew install postgresql@16 redis# Clone repository
git clone https://github.com/asmoyou/LinX.git
cd LinX
# Create Python virtual environment
cd backend
python3.11 -m venv venv
source venv/bin/activate
# Install Python dependencies
pip install -r requirements.txt
# Configure environment
cd ..
cp .env.example .env
# Edit .env with your configuration
nano .env# Ensure Docker Desktop is running
# Start infrastructure services
docker compose up -d
# Wait for services to be ready
sleep 30
# Run database migrations
cd backend
source venv/bin/activate
alembic upgrade headOpen PowerShell as Administrator:
# Download the repository
git clone https://github.com/asmoyou/LinX.git
cd LinX
# Run the setup script
.\infrastructure\scripts\setup-windows.ps1The script will:
- Install Chocolatey package manager
- Install WSL 2
- Install Docker Desktop
- Install Python 3.11+
- Install Git
- Install Python dependencies
Note: You will need to restart your computer after installation.
Open PowerShell as Administrator:
# Enable WSL
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
# Enable Virtual Machine Platform
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
# Restart computer
Restart-Computer
# After restart, set WSL 2 as default
wsl --set-default-version 2
# Install Ubuntu from Microsoft Store
# Or use: wsl --install -d UbuntuDownload and install Docker Desktop from: https://www.docker.com/products/docker-desktop
Ensure "Use WSL 2 based engine" is enabled in Docker Desktop settings.
Download and install Python from: https://www.python.org/downloads/
Ensure "Add Python to PATH" is checked during installation.
Download and install Git from: https://git-scm.com/download/win
Open PowerShell:
# Clone repository
git clone https://github.com/asmoyou/LinX.git
cd LinX
# Create Python virtual environment
cd backend
python -m venv venv
.\venv\Scripts\Activate.ps1
# Install Python dependencies
pip install -r requirements.txt
# Configure environment
cd ..
copy .env.example .env
# Edit .env with your configuration
notepad .env# Ensure Docker Desktop is running
# Start infrastructure services
docker compose up -d
# Wait for services to be ready
Start-Sleep -Seconds 30
# Run database migrations
cd backend
.\venv\Scripts\Activate.ps1
alembic upgrade headEdit the .env file with your configuration:
# Database
DATABASE_URL=postgresql://postgres:your_password@localhost:5432/workforce
# Redis
REDIS_URL=redis://localhost:6379/0
# MinIO
MINIO_ENDPOINT=localhost:9000
MINIO_ACCESS_KEY=your_access_key
MINIO_SECRET_KEY=your_secret_key
# Milvus
MILVUS_HOST=localhost
MILVUS_PORT=19530
# LLM Provider (Ollama)
OLLAMA_BASE_URL=http://localhost:11434
# JWT Secret
JWT_SECRET=your_jwt_secret_here
# Encryption Key (32 bytes for AES-256)
ENCRYPTION_KEY=your_encryption_key_herecd backend
source venv/bin/activate # On Windows: .\venv\Scripts\Activate.ps1
# Run migrations
alembic upgrade head
# Create admin user (optional)
python -c "
from database.connection import get_db_session
from access_control.models import User
from access_control.rbac import Role
with get_db_session() as session:
admin = User(
username='admin',
email='admin@example.com',
role=Role.ADMIN.value
)
admin.set_password('admin123') # Change this!
session.add(admin)
session.commit()
print('Admin user created')
"Linux:
curl https://ollama.ai/install.sh | sh
ollama pull llama2macOS:
brew install ollama
ollama pull llama2Windows: Download from https://ollama.ai/download
# Start API Gateway
cd backend
source venv/bin/activate
uvicorn api_gateway.main:app --host 0.0.0.0 --port 8000
# In another terminal, start frontend (for development)
cd frontend
npm install
npm run dev# Check Docker containers
docker ps
# Expected containers:
# - postgres
# - redis
# - minio
# - milvus
# - etcd# Health check
curl http://localhost:8000/health
# Expected response:
# {"status":"healthy","version":"1.0.0"}Open browser and navigate to:
- Development: http://localhost:5173
- Production: http://localhost:80
cd backend
source venv/bin/activate
python -c "
from database.connection import get_db_session
with get_db_session() as session:
result = session.execute('SELECT 1')
print('Database connection successful')
"curl http://localhost:11434/api/generate -d '{
"model": "llama2",
"prompt": "Hello, world!"
}'Problem: Docker daemon not running
# Linux
sudo systemctl start docker
sudo systemctl status docker
# macOS/Windows
# Start Docker Desktop from ApplicationsProblem: Permission denied
# Add user to docker group
sudo usermod -aG docker $USER
# Log out and back in for changes to take effectProblem: Cannot connect to PostgreSQL
# Check if PostgreSQL is running
docker ps | grep postgres
# Check logs
docker logs postgres
# Restart PostgreSQL
docker compose restart postgresProblem: Migration fails
# Reset database (WARNING: This will delete all data)
docker compose down -v
docker compose up -d
cd backend
alembic upgrade headProblem: Module not found
# Ensure virtual environment is activated
source venv/bin/activate # Linux/macOS
.\venv\Scripts\Activate.ps1 # Windows
# Reinstall dependencies
pip install -r requirements.txtProblem: Python version mismatch
# Check Python version
python --version
# Should be 3.11 or later
# If not, install correct version and recreate venvProblem: Port already in use
# Find process using port
lsof -i :8000 # Linux/macOS
netstat -ano | findstr :8000 # Windows
# Kill process or change port in configurationProblem: Ollama not responding
# Check if Ollama is running
curl http://localhost:11434/api/tags
# Restart Ollama
# Linux: sudo systemctl restart ollama
# macOS: brew services restart ollama
# Windows: Restart Ollama from Start MenuAfter successful installation:
- Configure LLM Providers: See Configuration Guide
- Set Up Users: Create user accounts and assign roles
- Deploy Agents: Create and deploy AI agents
- Upload Knowledge: Upload documents to knowledge base
- Submit Tasks: Start submitting goals and tasks
- Docker Compose Deployment
- Kubernetes Deployment
- Configuration Guide
- User Manual
- Troubleshooting Guide
For installation issues:
- Check Troubleshooting Guide
- Review logs:
docker compose logs - Open an issue on GitHub
- Contact support: support@example.com