Token导航 LogoToken导航

Agent Skill · 研究检索

afrexai-self-hosting-mastery(afrexai 自托管掌握)

afrexai-self-hosting-mastery 用于查找、检索和筛选相关信息,适合在 OpenClaw 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

afrexai-self-hosting-mastery 是研究检索类 Agent Skill,可用宿主为 OpenClaw,通过ClawHub获取,权限为接触敏感数据;许可证为 MIT-0,第三方扫描有提醒项,按安装量在研究检索类的 73,675 个 Skill 里排第 9,037。

总安装 15,054周安装 609GitHub Stars 公开资料未说明下载 4,726核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT-0
版本
1.0.0

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:afrexai-self-hosting-mastery(afrexai 自托管掌握)
来源仓库:https://github.com/1kalin/afrexai-self-hosting-mastery
安装命令:
openclaw skills install afrexai-self-hosting-mastery
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install afrexai-self-hosting-mastery

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

完整的自托管和家庭实验室操作系统,支持生产级可靠性维护。适合在 OpenClaw 中需要部署、监控和保护自托管服务时使用。提供安全防护、事件响应和持续运维的完整指南。安装命令:openclaw skills install afrexai-self-hosting-mastery,需确认服务器访问权限。

建议核实是否会执行远程命令或修改防火墙规则。

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 OpenClaw;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 openclaw skills install afrexai-self-hosting-mastery;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

afrexai-self-hosting-mastery 怎么安装?

在终端执行 openclaw skills install afrexai-self-hosting-mastery。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

afrexai-self-hosting-mastery 支持哪些 AI 工具?

公开资料标注支持 OpenClaw。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

afrexai-self-hosting-mastery 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

afrexai-self-hosting-mastery 是免费的吗?

来源标注的许可证是 MIT-0。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

afrexai-self-hosting-mastery 用的人多吗?

公开数据是累计安装 15,054 次,近一周安装 609 次,下载 4,726 次。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

afrexai-self-hosting-mastery 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 专注 OpenClaw 一种宿主,触发方式和使用习惯不用来回切换。
  • 许可证明确为 MIT-0,商用和分发边界好判断。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 OpenClaw,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
afrexai-self-hosting-mastery

afrexai 自托管掌握 · 本页

15,054—接触敏感数据MIT-0有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

name
afrexai-self-hosting-mastery
description
Complete self-hosting and homelab operating system. Deploy, secure, monitor, and maintain self-hosted services with production-grade reliability. Use when setting up home servers, Docker infrastructure, reverse proxies, backups, monitoring, or evaluating self-hosted alternatives to SaaS.

Self-Hosting Mastery

Complete system for building and operating reliable self-hosted infrastructure — from first server to multi-node homelab.

Phase 1: Infrastructure Assessment

Server Profile YAML

server_profile:
  name: ""
  hardware:
    cpu: ""              # e.g., "Intel i5-12400" or "Raspberry Pi 5"
    ram_gb: 0
    storage:
      - device: ""       # e.g., "/dev/sda"
        type: ""         # ssd | hdd | nvme
        size_gb: 0
        role: ""         # boot | data | backup
    network: ""          # 1gbe | 2.5gbe | 10gbe
  os: ""                 # debian | ubuntu | proxmox | unraid | truenas
  location: ""           # home | closet | rack | colo | vps
  power:
    ups: false
    wattage_idle: 0
    wattage_load: 0
    monthly_cost_estimate: ""  # electricity
  network:
    public_ip: ""        # static | dynamic | cgnat
    domain: ""
    dns_provider: ""     # cloudflare | duckdns | custom
    isp_ports_open: true # some ISPs block 80/443
  goals:
    - ""                 # media server, smart home, dev environment, etc.
  budget_monthly: ""     # electricity + domain + any VPS

Hardware Decision Matrix

BudgetRAMStorageGood ForExample Hardware
$04-8GB64GB+Pi-hole, AdGuard, small toolsRaspberry Pi 4/5
$50-1508-16GB256GB+Docker host, 5-10 servicesUsed SFF PC (Dell Optiplex, Lenovo Tiny)
$150-40016-32GB1TB+NAS + services, media serverMini PC (Intel NUC, Beelink)
$400-80032-64GB4TB+Full homelab, VMs + containersUsed enterprise (Dell R720, HP DL380)
$800+64GB+10TB+Multi-node, Proxmox clusterMultiple nodes, dedicated NAS

Self-Host vs SaaS Decision

Ask before self-hosting anything:

  1. Data sensitivity — Does keeping data local matter? (passwords, health, finance = yes)
  2. Reliability need — Can you tolerate occasional downtime? (email = risky, media = fine)
  3. Maintenance budget — Do you have 2-4 hours/month for updates?
  4. Skill level — Can you debug Docker/networking issues?
  5. Cost comparison — Is the SaaS < $10/mo? Often not worth self-hosting for trivial savings.

Always self-host: Password manager, DNS/ad-blocking, VPN, bookmarks, notes Usually self-host: Media server, file sync, photo backup, monitoring, git Think twice: Email (deliverability hell), calendar (sync complexity), chat (uptime expectations) Rarely worth it: Search engine (resource hungry), social media (no network effect)


Phase 2: OS & Virtualization

OS Selection Guide

OSBest ForLearning CurveNotes
Debian 12Docker-only hostLowStable, minimal, just works
Ubuntu Server 24.04Beginners, wide docsLowMore packages, snap controversy
Proxmox VEVMs + containersMediumFree, enterprise features, ZFS
UnraidNAS + Docker + VMsMedium$59-129, great UI, parity array
TrueNAS ScaleZFS NAS + DockerMediumFree, ZFS-first, apps improving
NixOSReproducible configsHighDeclarative, steep learning curve

Proxmox Quick Setup

# Post-install essentials
# 1. Remove enterprise repo (if no subscription)
sed -i 's/^deb/#deb/' /etc/apt/sources.list.d/pve-enterprise.list
echo "deb http://download.proxmox.com/debian/pve bookworm pve-no-subscription" > /etc/apt/sources.list.d/pve-no-subscription.list
apt update && apt upgrade -y

# 2. Create a Docker LXC (lightweight container)
# Download template: Datacenter → Storage → CT Templates → Download → debian-12
# Create CT: 2 cores, 2GB RAM, 32GB disk, bridge vmbr0
# Inside CT: install Docker
apt install -y curl
curl -fsSL https://get.docker.com | sh

# 3. Enable IOMMU for GPU passthrough (if needed)
# Edit /etc/default/grub: GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on"
# update-grub && reboot

VM vs LXC vs Docker Decision

FactorVMLXCDocker
IsolationFull (own kernel)Partial (shared kernel)Process-level
OverheadHigh (1-2GB base)Low (50-200MB)Minimal
Use whenDifferent OS, GPU passthrough, untrusted workloadsDedicated service host, ZFS datasetsMost services
Avoid whenRAM-constrainedNeed Windows, custom kernelStateful databases (use LXC/VM)

Rule: Docker for 90% of services. LXC for Docker hosts or isolated environments. VM for Windows, different kernel needs, or GPU passthrough.


Phase 3: Docker Infrastructure

Docker Compose Project Structure

/opt/stacks/           # or ~/docker/
├── traefik/
│   ├── docker-compose.yml
│   ├── .env
│   ├── config/
│   │   └── traefik.yml
│   └── data/
│       ├── acme.json          # chmod 600
│       └── dynamic/
├── monitoring/
│   ├── docker-compose.yml
│   ├── .env
│   └── config/
├── media/
│   ├── docker-compose.yml
│   ├── .env
│   └── config/
├── productivity/
│   ├── docker-compose.yml
│   ├── .env
│   └── config/
└── scripts/
    ├── backup.sh
    ├── update-all.sh
    └── health-check.sh

Docker Compose Best Practices

# Template: production-grade service
services:
  app:
    image: vendor/app:1.2.3           # ALWAYS pin version
    container_name: app               # Explicit name
    restart: unless-stopped           # Auto-restart
    networks:
      - proxy                         # Traefik network
      - internal                      # Backend network
    volumes:
      - ./config:/config              # Bind mount for config
      - app-data:/data                # Named volume for data
    environment:
      - TZ=Europe/London              # Always set timezone
      - PUID=1000                     # Match host user
      - PGID=1000
    env_file:
      - .env                          # Secrets in .env (gitignored)
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.app.rule=Host(`app.example.com`)"
      - "traefik.http.routers.app.tls.certresolver=letsencrypt"
      - "traefik.http.services.app.loadbalancer.server.port=8080"
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 40s
    deploy:
      resources:
        limits:
          memory: 512M               # Prevent OOM cascades
    security_opt:
      - no-new-privileges:true        # Security hardening
    read_only: true                   # Where possible
    tmpfs:
      - /tmp

volumes:
  app-data:

networks:
  proxy:
    external: true
  internal:

Docker Security Checklist

  • [ ] Pin all image versions (never :latest in production)
  • [ ] Set restart: unless-stopped on all services
  • [ ] Use .env files for secrets (never hardcode in compose)
  • [ ] Set memory limits on all containers
  • [ ] Use security_opt: no-new-privileges:true
  • [ ] Use read_only: true where possible + tmpfs for /tmp
  • [ ] Create separate Docker networks per stack
  • [ ] Never expose database ports to 0.0.0.0
  • [ ] Run containers as non-root (PUID/PGID or user:)
  • [ ] Enable Docker content trust: export DOCKER_CONTENT_TRUST=1
  • [ ] Prune unused images/volumes monthly: docker system prune -af
  • [ ] Use named volumes (not anonymous) for all persistent data
  • [ ] Set TZ environment variable on every container

Phase 4: Reverse Proxy & SSL

Reverse Proxy Selection

ProxyBest ForSSLConfig StyleLearning Curve
TraefikDocker-native, auto-discoveryAuto (ACME)Labels + YAMLMedium
CaddySimplicity, auto-SSLAuto (built-in)CaddyfileLow
Nginx Proxy ManagerGUI preferenceAuto (UI)Web UIVery Low
Nginx (manual)Maximum controlManual/certbotConfig filesHigh

Recommendation: Traefik for Docker power users. Caddy for simplicity. NPM for beginners.

Traefik Production Config

# traefik/config/traefik.yml
api:
  dashboard: true
  insecure: false

entryPoints:
  web:
    address: ":80"
    http:
      redirections:
        entryPoint:
          to: websecure
          scheme: https
  websecure:
    address: ":443"
    http:
      tls:
        certResolver: letsencrypt

certificatesResolvers:
  letsencrypt:
    acme:
      email: you@example.com
      storage: /data/acme.json
      # Use DNS challenge if ISP blocks port 80
      # dnsChallenge:
      #   provider: cloudflare
      httpChallenge:
        entryPoint: web

providers:
  docker:
    exposedByDefault: false    # Explicit opt-in per service
    network: proxy
  file:
    directory: /data/dynamic
    watch: true

log:
  level: WARN

accessLog:
  filePath: /data/access.log
  bufferingSize: 100

Cloudflare Tunnel (Zero Port Forwarding)

For CGNAT or ISPs blocking ports — expose services without opening firewall:

# cloudflared/docker-compose.yml
services:
  cloudflared:
    image: cloudflare/cloudflared:2024.1.0
    container_name: cloudflared
    restart: unless-stopped
    command: tunnel run
    environment:
      - TUNNEL_TOKEN=${CF_TUNNEL_TOKEN}
    networks:
      - proxy

When to use Cloudflare Tunnel vs port forwarding:

  • CGNAT (no public IP) → Tunnel (only option)
  • ISP blocks 80/443 → Tunnel or DNS challenge + non-standard ports
  • Security-first → Tunnel (no open ports)
  • Performance-first → Direct (lower latency)
  • LAN-only access → Neither (use Tailscale/WireGuard)

Phase 5: Essential Services Stack

Tier 1 — Deploy First (Foundation)

ServicePurposeImageRAMNotes
Traefik/CaddyReverse proxy + SSLtraefik:v3.064MBGateway to everything
Pi-hole/AdGuardDNS + ad blockingpihole/pihole128MBNetwork-wide ad blocking
Authelia/AuthentikSSO + 2FAauthelia/authelia128MBProtect services without built-in auth
Uptime KumaMonitoringlouislam/uptime-kuma128MBKnow when things break
WatchtowerAuto-updatescontainrrr/watchtower32MBOptional — some prefer manual

Tier 2 — Core Services

ServicePurposeAltRAM
VaultwardenPassword managerBitwarden64MB
NextcloudFile sync + officeSeafile (lighter)512MB
ImmichPhoto backupPhotoPrism1-4GB
JellyfinMedia serverPlex (less free)512MB-2GB
Paperless-ngxDocument management-256MB
Home AssistantSmart home-512MB

Tier 3 — Power User

ServicePurposeRAM
Gitea/ForgejoGit hosting256MB
n8nWorkflow automation256MB
Grafana + PrometheusMetrics & dashboards512MB
TandoorRecipe management256MB
MealieMeal planning128MB
Linkwarden/HoarderBookmark manager256MB
Stirling PDFPDF tools512MB
IT-ToolsDeveloper utilities64MB

RAM Planning

Total RAM needed ≈ OS base (1-2GB) + sum of service RAM + 20% headroom
Example 16GB server:
  OS + Docker:     2 GB
  Traefik:         0.1 GB
  Pi-hole:         0.1 GB
  Authelia:        0.1 GB
  Uptime Kuma:     0.1 GB
  Vaultwarden:     0.1 GB
  Nextcloud:       0.5 GB
  Immich:          2.0 GB
  Jellyfin:        1.0 GB
  Paperless:       0.3 GB
  Home Assistant:  0.5 GB
  ──────────────────────
  Total:           6.8 GB → 8.2 GB with headroom
  Available:       ~7.8 GB free for more services

Phase 6: Networking & DNS

DNS Architecture

Internet → Cloudflare DNS → Your Public IP → Router → Server
                                                        ↓
                                             Reverse Proxy (Traefik)
                                                        ↓
                                     ┌──────────────────┼──────────────────┐
                                     ↓                  ↓                  ↓
                                app.domain.com   files.domain.com   media.domain.com

Split DNS (Access Services Locally Without Hairpin NAT)

# Pi-hole/AdGuard: Local DNS rewrites
# Point *.home.example.com → 192.168.1.100 (server LAN IP)
# External: Cloudflare points to public IP
# Result: LAN traffic stays local, external goes through internet

VPN for Remote Access

SolutionTypeBest ForComplexity
TailscaleMesh VPNEasiest setup, multi-deviceVery Low
WireGuardPoint-to-pointPerformance, full controlMedium
HeadscaleSelf-hosted TailscalePrivacy, no vendor lockMedium-High

Recommendation: Start with Tailscale (free for 3 users). Move to Headscale when you want full control.

Firewall Rules (UFW)

# Default deny incoming
ufw default deny incoming
ufw default allow outgoing

# Allow SSH (change port from 22!)
ufw allow 2222/tcp comment 'SSH'

# Allow HTTP/HTTPS for reverse proxy
ufw allow 80/tcp comment 'HTTP redirect'
ufw allow 443/tcp comment 'HTTPS'

# Allow local network for discovery
ufw allow from 192.168.1.0/24 comment 'LAN'

# Enable
ufw enable

Phase 7: Backup Strategy

3-2-1 Rule Implementation

3 copies:  Live data + Local backup + Remote backup
2 media:   SSD/HDD (server) + External drive or NAS
1 offsite: Cloud (Backblaze B2, Wasabi) or second location

Backup Script Template

#!/bin/bash
# /opt/stacks/scripts/backup.sh
set -euo pipefail

BACKUP_DIR="/mnt/backup/docker"
STACKS_DIR="/opt/stacks"
DATE=$(date +%Y-%m-%d_%H%M)
RETENTION_DAYS=30

log() { echo "[$(date '+%Y-%m-%d %H:%M:%S')] $1"; }

# 1. Stop services that need consistent backups
log "Stopping database services..."
cd "$STACKS_DIR/productivity" && docker compose stop db

# 2. Backup Docker volumes
log "Backing up volumes..."
for vol in $(docker volume ls -q); do
    docker run --rm \
        -v "$vol":/source:ro \
        -v "$BACKUP_DIR/volumes":/backup \
        alpine tar czf "/backup/${vol}_${DATE}.tar.gz" -C /source .
done

# 3. Backup compose files and configs
log "Backing up configs..."
tar czf "$BACKUP_DIR/configs/stacks_${DATE}.tar.gz" \
    --exclude='*.log' \
    --exclude='node_modules' \
    "$STACKS_DIR"

# 4. Restart services
log "Restarting services..."
cd "$STACKS_DIR/productivity" && docker compose start db

# 5. Cleanup old backups
log "Cleaning up backups older than ${RETENTION_DAYS} days..."
find "$BACKUP_DIR" -name "*.tar.gz" -mtime +$RETENTION_DAYS -delete

# 6. Sync to remote (Backblaze B2 example)
# rclone sync "$BACKUP_DIR" b2:my-backups/docker/ --transfers 4

# 7. Verify
BACKUP_SIZE=$(du -sh "$BACKUP_DIR" | cut -f1)
log "Backup complete. Total size: $BACKUP_SIZE"

# 8. Send notification (optional)
# curl -s "https://ntfy.sh/my-backups" -d "Backup complete: $BACKUP_SIZE"

Backup Schedule

WhatFrequencyRetentionMethod
Docker volumesDaily 3 AM30 daysScript + cron
Compose files + configsDaily 3 AM90 daysScript + cron
Database dumpsEvery 6 hours7 dayspg_dump/mysqldump
Full disk imageMonthly3 monthsClonezilla/dd
Offsite syncDaily 5 AM60 daysrclone to B2/Wasabi

Backup Verification (Monthly)

  • [ ] Pick a random backup from last week
  • [ ] Restore to a test VM/container
  • [ ] Verify data integrity (check file counts, DB row counts)
  • [ ] Time the restore process (document RTO)
  • [ ] Log results in backup-verification.md

Phase 8: Monitoring & Alerting

Monitoring Stack (Docker Compose)

# monitoring/docker-compose.yml
services:
  uptime-kuma:
    image: louislam/uptime-kuma:1
    container_name: uptime-kuma
    restart: unless-stopped
    volumes:
      - uptime-data:/app/data
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.uptime.rule=Host(`status.example.com`)"

  prometheus:
    image: prom/prometheus:v2.49.0
    container_name: prometheus
    restart: unless-stopped
    volumes:
      - ./config/prometheus.yml:/etc/prometheus/prometheus.yml:ro
      - prometheus-data:/prometheus
    command:
      - '--config.file=/etc/prometheus/prometheus.yml'
      - '--storage.tsdb.retention.time=30d'

  grafana:
    image: grafana/grafana:10.3.0
    container_name: grafana
    restart: unless-stopped
    volumes:
      - grafana-data:/var/lib/grafana
    environment:
      - GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD}

  node-exporter:
    image: prom/node-exporter:v1.7.0
    container_name: node-exporter
    restart: unless-stopped
    pid: host
    volumes:
      - /proc:/host/proc:ro
      - /sys:/host/sys:ro
      - /:/rootfs:ro
    command:
      - '--path.procfs=/host/proc'
      - '--path.sysfs=/host/sys'
      - '--path.rootfs=/rootfs'

  cadvisor:
    image: gcr.io/cadvisor/cadvisor:v0.49.0
    container_name: cadvisor
    restart: unless-stopped
    volumes:
      - /:/rootfs:ro
      - /var/run:/var/run:ro
      - /sys:/sys:ro
      - /var/lib/docker/:/var/lib/docker:ro

volumes:
  uptime-data:
  prometheus-data:
  grafana-data:

Alert Rules

MetricWarningCriticalAction
Disk usage>80%>90%Cleanup or expand
RAM usage>85%>95%Identify memory leak, add RAM
CPU sustained>80% 5min>95% 5minCheck runaway process
Container restart>2/hour>5/hourCheck logs, fix root cause
SSL cert expiry<14 days<3 daysRenew cert
Backup age>26 hours>48 hoursCheck backup script/cron
Service down>2 min>10 minInvestigate, restart

Notification Channels

ChannelServiceBest For
Push notificationntfy.sh (self-hosted)Mobile alerts
ChatDiscord/Slack webhookTeam alerts
EmailUptime Kuma built-inFormal notifications
DashboardGrafana + Uptime KumaVisual monitoring

Phase 9: Security Hardening

Server Hardening Checklist

# 1. SSH hardening
# /etc/ssh/sshd_config
Port 2222                          # Change default port
PermitRootLogin no                 # No root SSH
PasswordAuthentication no          # Key-only
MaxAuthTries 3
AllowUsers yourusername

# 2. Install fail2ban
apt install fail2ban -y
systemctl enable fail2ban

# 3. Automatic security updates
apt install unattended-upgrades -y
dpkg-reconfigure -plow unattended-upgrades

# 4. Disable unused services
systemctl list-unit-files --state=enabled
# Disable anything you don't need

Authentication Architecture

Internet → Traefik → Authelia/Authentik → Service
                         ↓
                    Check: authenticated?
                    Yes → Forward to service
                    No → Redirect to login page + 2FA

Authelia (lightweight, YAML config) — good for smaller setups Authentik (full IdP, web UI) — good for many users/services, SAML/OIDC

Security Scoring (0-100)

DimensionWeightScore Guide
SSH hardened (keys, non-root, non-22)150=default, 15=fully hardened
Firewall active (deny-by-default)150=none, 15=UFW/iptables configured
Reverse proxy (no direct port exposure)150=ports exposed, 15=all behind proxy
SSL/TLS on all services100=HTTP, 10=HTTPS everywhere
Auth on all public services150=open, 15=SSO/2FA on everything
Container security (non-root, limits)100=default, 10=hardened
Auto-updates enabled100=manual, 10=automated
Secrets management (.env, not hardcoded)100=in compose, 10=.env + restricted perms

Score: 0-40 = Vulnerable, 41-70 = Acceptable, 71-90 = Good, 91-100 = Hardened


Phase 10: Maintenance & Updates

Update Strategy

Option A: Manual (Recommended for critical services)

# Update script: /opt/stacks/scripts/update-all.sh
#!/bin/bash
set -euo pipefail

STACKS_DIR="/opt/stacks"
LOG="/var/log/docker-updates.log"

for stack in "$STACKS_DIR"/*/; do
    if [ -f "$stack/docker-compose.yml" ]; then
        echo "[$(date)] Updating $(basename $stack)..." | tee -a "$LOG"
        cd "$stack"
        docker compose pull 2>&1 | tee -a "$LOG"
        docker compose up -d 2>&1 | tee -a "$LOG"
    fi
done

docker image prune -f | tee -a "$LOG"
echo "[$(date)] Update complete" | tee -a "$LOG"

Option B: Watchtower (Automated — use with caution)

services:
  watchtower:
    image: containrrr/watchtower:1.7.1
    container_name: watchtower
    restart: unless-stopped
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      - WATCHTOWER_SCHEDULE=0 0 4 * * MON  # Monday 4 AM
      - WATCHTOWER_CLEANUP=true
      - WATCHTOWER_NOTIFICATIONS=shoutrrr
      - WATCHTOWER_NOTIFICATION_URL=discord://webhook
      - WATCHTOWER_LABEL_ENABLE=true    # Only update labeled containers
    # Add label to containers: com.centurylinklabs.watchtower.enable=true

Weekly Maintenance Checklist

  • [ ] Check Uptime Kuma for any downtime events
  • [ ] Review disk usage (df -h)
  • [ ] Check container health (docker ps --filter health=unhealthy)
  • [ ] Review fail2ban bans (fail2ban-client status)
  • [ ] Check backup logs (last successful backup)
  • [ ] Review Docker logs for errors (docker logs --since 7d <container>)
  • [ ] Prune unused resources (docker system prune -f)

Monthly Maintenance

  • [ ] Update all container images (read changelogs first!)
  • [ ] Update host OS (apt update && apt upgrade)
  • [ ] Test a backup restore
  • [ ] Review and rotate secrets/passwords
  • [ ] Check SSL certificate expiry dates
  • [ ] Review Grafana dashboards for trends
  • [ ] Clean up unused Docker networks/volumes

Phase 11: Advanced Patterns

Multi-Node Architecture

┌─────────────┐     ┌─────────────┐     ┌─────────────┐
│   Node 1    │     │   Node 2    │     │   Node 3    │
│ (Proxy/DNS) │────│ (Services)  │────│   (NAS)     │
│ Traefik     │     │ Apps        │     │ TrueNAS     │
│ Pi-hole     │     │ Databases   │     │ NFS/SMB     │
│ Authelia    │     │ Media       │     │ Backup      │
└─────────────┘     └─────────────┘     └─────────────┘
       ↑                   ↑                   ↑
       └───────── Tailscale Mesh ──────────────┘

Docker Compose Includes (Compose v2.20+)

# Shared fragments
include:
  - path: ../common/traefik-labels.yml
  - path: ../common/logging.yml

services:
  app:
    # inherits common configs

GitOps for Homelab

homelab-configs/           # Git repo
├── .github/
│   └── workflows/
│       └── deploy.yml     # CI: lint + push to server
├── stacks/
│   ├── traefik/
│   ├── monitoring/
│   └── media/
├── scripts/
└── README.md

Workflow: Edit compose locally → commit → push → CI deploys to server Tools: Flux/ArgoCD (overkill), or simple git pull && docker compose up -d via webhook

Hardware Redundancy

ComponentSolutionCost
PowerUPS (APC Back-UPS 600VA+)$60-150
StorageRAID1/ZFS mirror (not RAID0!)2x disk cost
NetworkDual NIC, managed switch$30-100
ServerSecond node (cold spare or active)$100-400

Rule: RAID is NOT backup. It protects against disk failure only, not ransomware/deletion/corruption.


Phase 12: Troubleshooting

Common Issues Decision Tree

Service not accessible?
├── Can you ping the server? → No → Network/firewall issue
├── Is the container running? (`docker ps`) → No → Check logs: `docker logs <name>`
├── Is the port exposed? (`docker port <name>`) → No → Check compose ports/networks
├── Is Traefik routing? (Check Traefik dashboard) → No → Check labels, network
├── Is DNS resolving? (`dig app.example.com`) → No → Check DNS provider
└── SSL error? → Check acme.json permissions (chmod 600), cert resolver logs

Docker Debug Commands

# Container not starting
docker logs <name> --tail 50
docker inspect <name> | jq '.[0].State'

# Network issues
docker network ls
docker network inspect <network>
docker exec <name> ping other-container

# Resource issues
docker stats                          # Live resource usage
docker system df                      # Disk usage
docker volume ls -f dangling=true     # Orphaned volumes

# Nuclear options (use carefully)
docker compose down && docker compose up -d    # Full restart
docker system prune -af --volumes              # Clean EVERYTHING

Performance Optimization

SymptomLikely CauseFix
Slow file accessHDD for databaseMove DB to SSD
High CPU idleMonitoring too frequentIncrease scrape intervals
OOM killsNo memory limitsSet deploy.resources.limits.memory
Slow NextcloudMissing Redis cacheAdd Redis container
Jellyfin bufferingNo hardware transcodingEnable GPU passthrough
Slow Docker buildsNo layer cachingUse multi-stage + .dockerignore

Service Configuration Quick Reference

Vaultwarden (Password Manager)

services:
  vaultwarden:
    image: vaultwarden/server:1.30.5
    container_name: vaultwarden
    restart: unless-stopped
    volumes:
      - vaultwarden-data:/data
    environment:
      - SIGNUPS_ALLOWED=false       # Disable after creating your account
      - WEBSOCKET_ENABLED=true
      - ADMIN_TOKEN=${ADMIN_TOKEN}  # Generate: openssl rand -base64 48
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.vault.rule=Host(`vault.example.com`)"

Immich (Photo Backup)

# Use their official docker-compose.yml from:
# https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml
# Key settings:
# - Set UPLOAD_LOCATION to a large storage mount
# - Enable hardware transcoding if GPU available
# - Set IMMICH_MACHINE_LEARNING_URL for face detection

Paperless-ngx (Document Management)

services:
  paperless:
    image: ghcr.io/paperless-ngx/paperless-ngx:2.4
    container_name: paperless
    restart: unless-stopped
    volumes:
      - paperless-data:/usr/src/paperless/data
      - paperless-media:/usr/src/paperless/media
      - ./consume:/usr/src/paperless/consume  # Drop PDFs here
      - ./export:/usr/src/paperless/export
    environment:
      - PAPERLESS_OCR_LANGUAGE=eng
      - PAPERLESS_TIME_ZONE=Europe/London
      - PAPERLESS_ADMIN_USER=${ADMIN_USER}
      - PAPERLESS_ADMIN_PASSWORD=${ADMIN_PASS}

Homelab Quality Rubric (0-100)

DimensionWeight0 (Poor)50 (Decent)100 (Excellent)
Security20%Default passwords, open portsFirewall + SSLHardened SSH, SSO/2FA, no-new-privileges
Backups20%NoneLocal only, untested3-2-1, automated, verified monthly
Monitoring15%NoneUptime Kuma onlyFull stack: metrics + logs + alerts
Documentation10%Nothing writtenREADME per stackGitOps, full runbook, diagrams
Updates10%Never updatedManual quarterlyScheduled weekly, changelogs reviewed
Reliability10%Frequent crashesMostly stableUPS, auto-restart, health checks
Performance10%Slow, OOM killsAdequateResource limits, SSD, HW transcoding
Scalability5%Single machine, no planCompose organizedMulti-node ready, IaC

10 Self-Hosting Mistakes

#MistakeFix
1Using :latest tagPin versions: image:1.2.3
2No backups3-2-1 backup rule, test restores
3Exposing ports directlyEverything behind reverse proxy
4Default passwordsChange immediately, use password manager
5No monitoringUptime Kuma minimum, Grafana for depth
6RAID = backup mentalityRAID protects disks, not data
7Over-engineering day 1Start small, add complexity as needed
8No documentationDocument every service, every port, every cron
9Ignoring updatesSecurity patches matter, schedule updates
10Running as rootNon-root containers, restricted SSH

Natural Language Commands

SayAgent Does
"Set up a new service"Guide through compose file creation with security best practices
"Audit my homelab security"Run through security scoring checklist
"Plan my backup strategy"Design 3-2-1 backup plan for your setup
"What should I self-host?"Assess needs and recommend services by tier
"My container keeps crashing"Walk through troubleshooting decision tree
"Help me set up Traefik"Generate production Traefik config with SSL
"Compare NAS options"Compare TrueNAS vs Unraid vs DIY for your needs
"Optimize my Docker setup"Review compose files for security and performance
"Set up monitoring"Deploy Uptime Kuma + Prometheus + Grafana stack
"Plan a hardware upgrade"Assess current usage, recommend hardware by budget
"Migrate from cloud to self-hosted"Plan migration with data export and service mapping
"Set up remote access"Compare and deploy VPN/Tailscale for secure remote access

平台分布

OpenClaw

88.48%
按下载量换算4,182

安全审计

VirusTotal

可疑

ClawScan

可疑

Static analysis

未展示

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills