← 返回
未分类
中文
Self-Host
Deploy and maintain self-hosted services with security, backups, and long-term reliability.
部署并维护自托管服务,确保安全、备份和长期可靠性。
未分类
clawhub
v1.0.0 1 版本 99838.4 Key: 无需
#latest
概述
Self-Hosting Rules
Before Installing Anything
- Backups first — decide where data lives and how it's backed up before deploying, not after data exists
- Check resource requirements — many services need more RAM than expected, OOM kills corrupt data
- Verify the project is actively maintained — abandoned projects become security liabilities
Docker Fundamentals
- Always use named volumes or bind mounts for persistent data — anonymous volumes are lost on container removal
- Pin image versions (
nginx:1.25.3 not nginx:latest) — latest changes unexpectedly and breaks setups - Set restart policy (
unless-stopped or on-failure) — containers don't auto-start after reboot by default - Use
docker compose down not docker compose rm — down handles networks and volumes properly
Networking
- Never expose database ports to the internet — only the reverse proxy should be public
- Use a reverse proxy (Traefik, Caddy, Nginx Proxy Manager) — handles SSL, routing, and security in one place
- Create Docker networks per project — default bridge network lacks DNS resolution between containers
- Bind admin interfaces to localhost only (
127.0.0.1:8080:8080) — not all traffic needs to be public
SSL and Domains
- Use automatic SSL with Let's Encrypt — Caddy and Traefik do this natively
- For local/LAN access, use a real domain with DNS challenge — avoids browser certificate warnings
- Wildcard certificates simplify multi-service setups — one cert for *.home.example.com
Security Essentials
- Change all default passwords immediately — bots scan for default credentials within hours
- Enable automatic security updates for the host OS — unpatched systems get compromised
- Use fail2ban or equivalent — brute force attacks are constant
- Keep services behind authentication (Authelia, Authentik) — not everything has built-in auth
- Disable root SSH, use key-only authentication — password SSH is a vulnerability
Backups
- Test restores, not just backups — untested backups are wishful thinking
- 3-2-1 rule: 3 copies, 2 different media, 1 offsite — local RAID is not backup
- Automate backup schedules — manual backups get forgotten
- Back up Docker volumes, not containers — containers are ephemeral, data is not
Monitoring
- Set up uptime monitoring (Uptime Kuma is self-hostable) — know when services die before users tell you
- Monitor disk space — full disks cause silent failures and corruption
- Log rotation is mandatory — Docker logs grow forever by default, fill disks
- Consider resource monitoring (Netdata, Prometheus) — spot problems before they're critical
Maintenance
- Schedule regular update windows — services need updates, plan for downtime
- Document everything you deploy — future you won't remember why that container exists
- Keep a compose file repo — reproducibility matters when hardware fails
- Test updates on staging when possible — production surprises are painful
Home Server Specifics
- Dynamic DNS if ISP doesn't provide static IP — Cloudflare, DuckDNS work well
- UPS protects against power loss corruption — especially important for databases
- Consider power consumption — some hardware costs more in electricity than cloud hosting
- Port forwarding exposes your home network — use VPN (WireGuard, Tailscale) instead when possible
Common Mistakes
- Putting everything on one machine with no redundancy — single point of failure for all services
- Ignoring updates for months — security vulnerabilities accumulate
- No firewall rules — assuming "nobody knows my IP" is security
- Storing secrets in docker-compose.yml committed to git — use .env files, exclude from version control
- Over-engineering from day one — start simple, add complexity when needed
版本历史
共 1 个版本
-
v1.0.0
当前
2026-05-03 02:56 安全 安全
安全检测
腾讯云安全 (Sanbu)
安全,无风险
查看报告
🔗 相关推荐
it-ops-security
alex3alex
备份与恢复 OpenClaw 数据。适用于创建备份、设置自动备份计划、从备份恢复或管理备份轮转。处理 ~/.openclaw 目录归档并包含适当的排除规则。
★ 90
📥 30,874
office-efficiency
ivangdavila
创建、检查和编辑 Microsoft Word 文档及 DOCX 文件,支持样式、编号、修订记录、表格、分节符及兼容性检查等功能。
★ 458
📥 152,339
ai-agent
ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,398
📥 323,041