16 - Komodo Setup
Architecture Overview¶
Komodo Core: LXC 105 (Alpine-based, installed via community script)
Periphery Agent: LXC 100 (docker-host, systemd service)
Docker Stacks: /srv/docker-compose/ on LXC 100
Why systemd Periphery instead of Docker: - No filesystem separation issues - Direct host access to compose files - Simpler mount management - Recommended by Komodo maintainers for Files on Server mode
1. Komodo Core Installation (LXC 105)¶
Install via Proxmox Community Script¶
# On Proxmox host, run the community script
bash -c "$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/ct/komodo.sh)"
Script creates: - Alpine-based LXC (ID: 105) - Komodo Core with MongoDB - Auto-configured networking - Default port: 9120
Manual verification:
# Check LXC is running
pct status 105
# View Komodo logs
pct exec 105 -- docker logs komodo
# Check services
pct exec 105 -- docker ps
Access: http://192.168.0.105:9120
First login: Create admin account via UI
Post-Installation Configuration¶
# Enter Komodo LXC
pct enter 105
# View configuration
cat /etc/komodo/.env
# Restart if needed
docker restart komodo
docker restart mongodb
2. Periphery systemd Installation (LXC 100)¶
Prerequisites¶
# Enter LXC
pct enter 100
# Stop old Docker periphery if running
docker stop komodo_periphery
docker rm komodo_periphery
Install systemd Periphery¶
# Run installer as root
curl -sSL https://raw.githubusercontent.com/moghtech/komodo/main/scripts/setup-periphery.py | python3
# Enable on boot
systemctl enable periphery
# Check status
systemctl status periphery
# View config
cat /etc/komodo/periphery.config.toml
Configure Periphery¶
Edit /etc/komodo/periphery.config.toml:
port = 8120
bind_ip = "[::]"
# Add Core passkey - must match what's set in Komodo Core UI
passkeys = ["YOUR_RANDOM_PASSKEY_HERE"]
# Optional: whitelist Core IP
allowed_ips = ["192.168.0.109"]
Passkey synchronization: 1. Generate a random passkey:
2. Add it to/etc/komodo/periphery.config.toml on LXC 100
3. In Komodo UI when adding the Server: paste the same passkey in the Passkey field
Restart after changes:
3. Connect Periphery to Core¶
Get Komodo Core IP¶
In Komodo UI¶
- Navigate to Servers → New Server
- Fill in:
- Name: LXC 100
- Address: http://192.168.0.109:8120 (LXC 100's IP)
- Passkey: (same as in periphery.config.toml)
- Save and Refresh - should show green (OK)
Note: Komodo Core (LXC 105) connects TO Periphery (LXC 100), not the other way around.
4. Import Existing Docker Compose Stacks¶
Important: Dockge Path Trap¶
If stacks were previously managed by Dockge, be aware of this:
Dockge mounts /srv/docker-compose as /opt/stacks inside its container.
# docker compose ls shows /opt/stacks paths
NAME CONFIG FILES
bazarr /opt/stacks/bazarr/docker-compose.yml # ← Dockge container path
# But on host the files are actually at:
ls /srv/docker-compose/bazarr/docker-compose.yml # ← Real host path
This means:
- STACKS_FROM=compose would generate wrong paths (/opt/stacks/)
- STACKS_FROM=dir reads the directory directly → generates correct paths (/srv/docker-compose/)
- Always use STACKS_FROM=dir when compose files are on host
Why systemd Periphery Was Required¶
Docker-based Periphery had the same filesystem separation problem:
- Periphery inside Docker container couldn't see /srv/docker-compose/ unless explicitly mounted
- Even with mounts, path resolution caused "Remote Error" failures
- systemd Periphery runs directly on the host → sees all host paths natively
Setup komodo-import Tool¶
Create /srv/docker-compose/import/compose.yml:
services:
komodo-import:
image: foxxmd/komodo-import:latest
restart: no
volumes:
- /srv/docker-compose/:/filesOnServer
environment:
- HOST_DIR=/srv/docker-compose/
- STACKS_FROM=dir # Use 'dir' NOT 'compose' - 'compose' reads Docker daemon which returns Dockge container paths (/opt/stacks/) instead of real host paths (/srv/docker-compose/)
- SERVER_NAME=LXC 100
- DOCKER_HOST=tcp://socket-proxy:2375
depends_on:
- socket-proxy
socket-proxy:
image: lscr.io/linuxserver/socket-proxy:latest
environment:
- CONTAINERS=1
- INFO=1
- POST=0
- PING=1
- VERSION=1
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
read_only: true
tmpfs:
- /run
Run Import¶
# Enter LXC
pct enter 100
cd /srv/docker-compose/import
# Run
docker compose up
# View logs and copy TOML output
docker compose logs komodo-import
# Clean output - REQUIRED: remove docker log prefixes before pasting into Komodo
# Raw log output has "komodo-import-1 | " prefix on every line which breaks TOML parsing
docker compose logs komodo-import | sed 's/^komodo-import-1 | //' > /tmp/stacks.toml
# Verify clean TOML
cat /tmp/stacks.toml
Note: If you paste the raw log output directly into Komodo you will get:
This is because the log prefixes break TOML parsing. Always use thesed command above first.
Import to Komodo¶
- Copy TOML content from
/tmp/stacks.toml - Komodo UI: Syncs → New Sync
- Resource File tab: Paste TOML
- General tab:
- Sync Resources: ENABLED
- Delete Unmatched: DISABLED
- Execute Sync
Verify Import¶
- Go to Stacks menu
- All stacks should be visible with status indicators
- Click any stack → should show compose file contents
- Status should change from "DOWN" to actual state after refresh
5. Stack Management¶
Files on Server Mode¶
What it means:
- Compose files stay in /srv/docker-compose/
- Komodo doesn't move or copy them
- Komodo just runs docker compose commands on existing files
Editing stacks: - Edit files directly on host OR through Komodo UI - Changes persist across Komodo updates
Common Operations¶
Deploy stack:
# Via UI: Stack → Deploy button
# Or manually:
cd /srv/docker-compose/STACK_NAME
docker compose up -d
View logs:
- Komodo UI: Stack → Log tab
- Or: docker compose logs -f
Update images:
- Komodo UI: Stack → Pull Images → Deploy
- Or: docker compose pull && docker compose up -d
6. Git Sync Setup (Future)¶
Option A: Resource Sync (Komodo Config Only)¶
What it syncs: Komodo's TOML configurations (not compose files)
- Create git repo for Komodo configs
- Komodo UI: Syncs → Edit sync
- General tab → Managed mode: ENABLED
- Configure git provider (GitHub/GitLab/Gitea)
- Komodo pushes TOML changes to git automatically
Files stay: /srv/docker-compose/ (not in git)
Option B: Git-Backed Stacks (Full Version Control)¶
What it syncs: Actual compose files in git
Setup Process¶
-
Initialize git in compose directory:
-
Configure Git Provider in Komodo:
- Settings → Providers → Git Accounts
-
Add GitHub/GitLab account with access token
-
Convert Stacks to Git-Backed:
For each stack: - Stack → Config → Source: Change to "Git" - Repository: Select repo - Branch: main - Path: Stack subdirectory path - Save
- Komodo behavior:
- Clones repo to
/etc/komodo/stacks/STACK_NAME - Pulls updates on schedule or manual trigger
- Can push changes back if Managed mode enabled
Workflow¶
Pull changes:
# Git: Make changes, commit, push
git add docker-compose.yml
git commit -m "Update nginx config"
git push
# Komodo: Stack → Refresh button
# Or enable auto-pull on schedule
Push changes from Komodo: - Edit in Komodo UI - Changes auto-committed and pushed to git
Recommended Approach¶
Start with Option A (Resource Sync): - Simpler setup - Versions your Komodo configurations - Files stay in familiar location
Migrate to Option B later if needed: - When you want full compose file versioning - When collaborating with team - When you need rollback capabilities
7. Maintenance¶
Disk Space Management¶
LXC 100 (Periphery + Stacks):
# Check disk usage
pct exec 100 -- df -h /
# Clean Docker
pct exec 100 -- docker image prune -a # Remove unused images
pct exec 100 -- docker volume prune # Remove unused volumes
pct exec 100 -- docker system prune -a # Full cleanup
LXC 105 (Komodo Core):
# Check disk usage
pct exec 105 -- df -h /
# Clean Core logs if needed
pct exec 105 -- docker logs komodo --tail 100
Update Komodo Core¶
Via community script (recommended):
# Re-run the community script on Proxmox host
bash -c "$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/ct/komodo.sh)"
# Choose "Update" option
Manual update:
Update Periphery¶
pct exec 100 -- systemctl stop periphery
pct exec 100 -- curl -sSL https://raw.githubusercontent.com/moghtech/komodo/main/scripts/setup-periphery.py | python3
pct exec 100 -- systemctl start periphery
Backup Strategy¶
What to backup:
1. LXC 105 (Komodo Core):
- Full LXC backup: vzdump 105 --storage local --compress zstd
- Or just database: /var/lib/docker/volumes/komodo_mongo-data/
- LXC 100 (Periphery + Stacks):
- Periphery config:
/etc/komodo/periphery.config.toml - Docker compose files:
/srv/docker-compose/ - Docker data:
/srv/docker-data/(per-service)
Backup script:
#!/bin/bash
BACKUP_DIR=/mnt/backup/komodo-$(date +%Y%m%d)
mkdir -p $BACKUP_DIR
# Komodo Core LXC
vzdump 105 --storage local --compress zstd --dumpdir $BACKUP_DIR
# LXC 100 compose files
pct exec 100 -- tar -czf /tmp/compose-backup.tar.gz /srv/docker-compose
pct exec 100 -- tar -czf /tmp/periphery-backup.tar.gz /etc/komodo
cp /var/lib/lxc/100/rootfs/tmp/*.tar.gz $BACKUP_DIR/
Restore:
# Restore Komodo Core
pct restore 105 $BACKUP_DIR/vzdump-lxc-105-*.tar.zst
# Restore compose files
tar -xzf compose-backup.tar.gz -C /
8. Troubleshooting¶
Stack shows "DOWN" but containers running¶
Cause: Stack name in Komodo doesn't match Docker compose project name
Check:
Fix: Rename stack in Komodo to match project name
"Remote Error" when accessing stack¶
Cause: Periphery can't access compose files
Check:
# From Komodo Core host
curl -k https://192.168.0.109:8120/
# From LXC
systemctl status periphery
journalctl -u periphery -f
Fix: Verify systemd periphery is running and paths are correct
"Failed to read compose file contents"¶
Cause: Run Directory path incorrect
Check:
Fix: Stack Config → Run Directory → correct path
Periphery not connecting to Core¶
Check connectivity from Core to Periphery:
Check firewall on LXC 100:
Check logs:
# Periphery logs
pct exec 100 -- journalctl -u periphery --no-pager -n 50
# Core logs
pct exec 105 -- docker logs komodo --tail 50
Common issues: - Wrong passkey in Core or Periphery config - IP whitelist blocking connection - Firewall blocking port 8120 - LXC network bridge issues
9. Current Setup Summary¶
Infrastructure: - Proxmox Host: 192.168.0.109 - LXC 105: Komodo Core (Alpine + MongoDB) - Access: http://192.168.0.105:9120 - Installed via: Community Script - LXC 100: docker-host - Periphery: systemd service on port 8120 - Docker stacks: /srv/docker-compose/
Stacks: 33 stacks in Files on Server mode
- Location: /srv/docker-compose/ on LXC 100
- Managed via: Komodo UI (LXC 105)
- Status: All visible and operational
Network Flow:
User → Komodo Core (LXC 105:9120)
↓
Komodo Core → Periphery (LXC 100:8120)
↓
Periphery → Docker (LXC 100)
Authentication: - Komodo Core ↔ Periphery: HTTPS (self-signed) + passkey - Periphery → Docker: Unix socket
Next Steps: - [ ] Configure auto-updates for critical stacks - [ ] Set up Resource Sync for config versioning - [ ] Enable disk space alerts - [ ] Plan migration to git-backed stacks (optional) - [x] Disable/remove Dockge (no longer needed) ✅ - [x] Document LXC 105 IP for future reference ✅ (192.168.0.105)
10. Useful Commands¶
# Komodo Core (LXC 105)
pct status 105
pct enter 105
pct exec 105 -- docker logs komodo -f
pct exec 105 -- docker logs mongodb -f
pct exec 105 -- docker restart komodo
# Periphery (LXC 100)
pct exec 100 -- systemctl status periphery
pct exec 100 -- systemctl restart periphery
pct exec 100 -- journalctl -u periphery -f
# Docker stacks on LXC 100
pct exec 100 -- docker ps -a
pct exec 100 -- docker compose ls
pct exec 100 -- docker compose -f /srv/docker-compose/STACK/docker-compose.yml logs
# Disk space
pct exec 100 -- df -h
pct exec 100 -- du -sh /srv/docker-data/*
pct exec 105 -- df -h
# LXC management
pct list
pct config 105
pct config 100