Step-by-step guide to configure AI Maestro's peer mesh network for managing agents across multiple machines.
Required:
- ✅ macOS 12.0+ (Monterey or later)
- ✅ Node.js 18.17+ or 20.x
- ✅ tmux 3.0+
- ✅ Git
Recommended:
- ✅ Tailscale (for secure remote access)
- ✅ pm2 (for running as a service)
Installation:
# Install Homebrew (if not already installed)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install dependencies
brew install node tmux git
# Install pm2 globally
npm install -g pm2
# Install Tailscale (recommended for remote peers)
brew install --cask tailscaleFollow these steps to connect your first peer.
Recommended: One-Line Installer
curl -fsSL https://raw.githubusercontent.com/23blocks-OS/ai-maestro/main/scripts/remote-install.sh | shThis handles prerequisites, installation, and configuration automatically.
With auto-start (recommended):
curl -fsSL https://raw.githubusercontent.com/23blocks-OS/ai-maestro/main/scripts/remote-install.sh | sh -s -- --auto-startAlternative: Manual Install
On Each Machine (same steps everywhere):
# Clone repository
git clone https://github.com/23blocks-OS/ai-maestro.git
cd ai-maestro
# Install dependencies
yarn install
# Build
yarn build
# Start with pm2
pm2 start ecosystem.config.js
pm2 save
pm2 startup # Follow instructions to enable auto-startOption A: Using Tailscale (Recommended)
# On the remote machine
tailscale ip -4
# Example output: 100.80.12.6Option B: Using Local Network
# On the remote machine
ifconfig | grep "inet " | grep -v 127.0.0.1
# Example output: 192.168.1.100From any node in your browser:
- Open http://localhost:23000
- Click Settings (bottom of sidebar)
- Click Add Host
- Enter peer URL:
http://100.80.12.6:23000(orhttp://192.168.1.100:23000) - Click Discover Host
- ✅ If successful: See green checkmark
- ❌ If failed: See Troubleshooting
- Customize name: "Mac Mini" or "Cloud Server"
- Click Add Host
🔄 Automatic Bidirectional Sync! Add once from any node - both sides discover each other automatically. New peers propagate to all connected nodes.
- Go back to Dashboard (click "Back to Dashboard")
- Click + (Create New Agent)
- Select host: Choose your new peer from dropdown
- Enter agent name:
test-remote-agent - Click Create Agent
🎉 Done! You should see your agent appear with a badge showing the peer name. You can now access the dashboard from any connected node!
Goal: Connect machines via encrypted VPN - access from anywhere.
Step 1: Setup Tailscale on Both Machines
# On both machines
brew install --cask tailscale
# Start Tailscale
open /Applications/Tailscale.app
# Login with your Tailscale account (same account on both!)
# Approve devices in Tailscale admin consoleStep 2: Note IP Addresses
# On remote machine (desktop)
tailscale ip -4
# Example: 100.80.12.6
# On local machine (laptop)
tailscale ip -4
# Example: 100.95.23.10Step 3: Test Connectivity
# From laptop
curl http://100.80.12.6:23000/api/sessions
# Should return: {"sessions":[...]}Step 4: Connect Peer via Settings UI
Benefits:
- ✅ Works from anywhere (home, coffee shop, vacation)
- ✅ Encrypted WireGuard tunnel
- ✅ No port forwarding needed
- ✅ No firewall configuration
- ✅ Access dashboard from either machine
Use Case: Remote access to home desktop from laptop
Goal: Fast local network without VPN overhead.
Step 1: Find Local IP Addresses
# On each machine
ifconfig en0 | grep "inet "
# Example output: inet 192.168.1.100
# Or use network preferences
# System Preferences → Network → WiFi/Ethernet → DetailsStep 2: Test Connectivity
# From any machine
curl http://192.168.1.100:23000/api/sessionsStep 3: Optional - Configure .local Domain
macOS supports Bonjour/mDNS for .local domains:
# Check hostname
hostname
# Example: Mac-Mini.local
# Test from another machine
curl http://Mac-Mini.local:23000/api/sessionsStep 4: Connect Peers via Settings UI
Use local IPs or .local domains in the Add Host wizard.
Benefits:
- ✅ Fastest performance (no VPN overhead)
- ✅ Simple setup
- ✅ No external service dependency
Drawbacks:
- ❌ Only works on same network
- ❌ Unencrypted traffic
Use Case: Home lab, office network, trusted environments
Goal: Add AWS/DigitalOcean/Hetzner server as a peer.
Step 1: Install AI Maestro on Cloud Server
# SSH into your cloud server
ssh user@your-server.com
# Install Node.js 20
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejs
# Install tmux
sudo apt-get install -y tmux
# Clone and build AI Maestro
git clone https://github.com/23blocks-OS/ai-maestro.git
cd ai-maestro
npm install -g yarn
yarn install
yarn build
# Install pm2
npm install -g pm2
# Start AI Maestro
pm2 start ecosystem.config.js
pm2 save
pm2 startup # Follow instructionsStep 2: Install Tailscale on Cloud Server
# Install Tailscale
curl -fsSL https://tailscale.com/install.sh | sh
# Start Tailscale
sudo tailscale up
# Get Tailscale IP
tailscale ip -4
# Example: 100.123.45.67Step 3: Connect Cloud Peer via Settings UI
Use Tailscale IP: http://100.123.45.67:23000
Benefits:
- ✅ Secure access over internet
- ✅ No need to expose port 23000 publicly
- ✅ Same workflow as local machines
- ✅ Access dashboard from any connected node
Cost Optimization:
# Stop services when not needed
pm2 stop ai-maestro
# Restart when needed
pm2 start ai-maestroUse Case: Bursty workloads, platform-specific builds (Linux), CI/CD
| Option | Security | Speed | Complexity | Works Remote? | Cost |
|---|---|---|---|---|---|
| Tailscale | ✅✅✅ Encrypted | ✅✅ Fast | ✅✅ Easy | ✅ Yes | Free tier available |
| Local Network | ✅✅✅ Fastest | ✅✅✅ Easiest | ❌ No | Free | |
| Port Forwarding | ✅✅ Fast | ✅ Yes | Free | ||
| VPN (OpenVPN) | ✅✅✅ Encrypted | ✅ Moderate | ✅ Yes | Varies |
Recommendation: Use Tailscale for remote peers, local network for trusted home/office.
If you need to run multiple instances on the same machine (not common):
// ecosystem.config.js on second instance
module.exports = {
apps: [{
name: 'ai-maestro-instance2',
script: './server.mjs',
env: {
NODE_ENV: 'production',
PORT: 23001, // Different port
},
}],
}Add in Settings: http://100.80.12.6:23001
macOS:
# Allow port 23000
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --add /usr/local/bin/nodeLinux (ufw):
# Allow from Tailscale only
sudo ufw allow from 100.0.0.0/8 to any port 23000Test peer health:
# Check if peer is responding
curl http://100.80.12.6:23000/api/sessions
# Check pm2 status
pm2 status
# View logs
pm2 logs ai-maestroSymptom: "Connection timeout - host is not reachable"
Solutions:
-
Check if AI Maestro is running on the peer:
# On peer machine pm2 status # Should show: ai-maestro | online
-
Test connectivity:
# From your machine curl http://PEER_IP:23000/api/sessions # Should return JSON with sessions
-
Check firewall:
# On peer machine (macOS) sudo /usr/libexec/ApplicationFirewall/socketfilterfw --getglobalstate # If enabled, add Node.js to allowed apps
-
Verify Tailscale is connected:
# On both machines tailscale status # Should show: Connected
-
Try local IP instead of Tailscale:
# Get local IP ifconfig | grep "inet " # Use: http://192.168.x.x:23000
Symptom: Peer added successfully, but agents don't show
Solutions:
-
Create a test agent on peer:
# SSH into peer or access its terminal tmux new-session -s test-session # Detach: Ctrl+B, then D
-
Refresh AI Maestro dashboard:
- Click refresh button in sidebar
- Or reload browser (Cmd+R)
-
Check peer logs:
# On peer pm2 logs ai-maestro # Look for errors
Symptom: Agent appears but terminal is blank or shows "Connecting..."
Solutions:
-
Check session exists on peer:
# On peer tmux ls # Should list the session
-
Check WebSocket upgrade in browser console:
Developer Tools → Console Look for: "WebSocket connection failed" -
Verify connectivity to peer:
# From your machine curl http://PEER_IP:23000/api/sessions -
Check for proxy/firewall blocking WebSockets:
- Some corporate firewalls block WebSocket upgrades
- Test on different network (mobile hotspot)
Symptom: Can't create agents on peer
Solutions:
-
Check file permissions:
# On peer ls -la ~/.aimaestro/ # Should be owned by your user
-
Check tmux permissions:
# On peer tmux new-session -s permission-test # If this fails, tmux has issues
- ✅ Use Tailscale for remote peers
- ✅ Use strong Tailscale account password + 2FA
- ✅ Don't expose port 23000 to public internet
- ✅ Use OS user accounts to isolate users
- ✅ Regularly update AI Maestro and dependencies
- ✅ Use local network for peers in same location
- ✅ Use Tailscale "exit nodes" for regional cloud peers
- ✅ Monitor peer resource usage (pm2 monit)
- ✅ Close unused agents to free resources
- ✅ Use pm2 auto-restart:
pm2 startup - ✅ Monitor peers with health checks (Settings → Hosts → test icon)
- ✅ Keep peers on stable power (UPS for critical machines)
- ✅ Use cloud peers as backup for critical tasks
- Concepts Guide - Understand the peer mesh architecture
- Use Cases - See real-world examples
- Network Access - Detailed networking guide
- GitHub Issues - Get help or report bugs