- getting-started.md: Moved checklist before Simple Setup, removed Round 4 section - authelia-customization.md: Updated Authentik reference to alternatives stack - services-overview.md: Added clickable links to all stack compose files - setup-homelab.sh: Added prompt to run deployment script after setup (defaults to yes) - traefik.yml: Changed default to DNS challenge for wildcard certificates (DuckDNS) All documentation now reflects wildcard certificate usage with DNS challenge.
7.5 KiB
Getting Started Guide
Welcome to your AI-powered homelab! This guide will walk you through setting up your production-ready infrastructure with Dockge, Traefik, Authelia, and 60+ services.
Getting Started Checklist
- Configure
.envfile with your domain and tokens - Run setup script (generates Authelia secrets and admin user)
- Log out and back in for Docker group permissions
- Run deployment script (deploys all core services)
- Access Dockge web UI
- Set up 2FA with Authelia
- Deploy additional stacks as needed via Dockge
- Configure Homepage dashboard widgets
Quick Setup (Recommended)
For most users, the automated setup script handles everything:
Prerequisites
- Fresh Debian/Ubuntu server (or existing system)
- Root/sudo access
- Internet connection
- VS Code with GitHub Copilot (for AI assistance)
Simple Setup
-
Connect to your server via SSH
-
Install git if needed
sudo apt update && sudo apt upgrade -y && sudo apt install git -
Clone the rep:
git clone https://github.com/kelinfoxy/AI-Homelab.git cd AI-Homelab -
Configure environment:
cp .env.example .env nano .env # Edit with your domain and tokensRequired variables in .env:
DOMAIN- Your DuckDNS domain (e.g., yourdomain.duckdns.org)DUCKDNS_TOKEN- Your DuckDNS token from duckdns.orgACME_EMAIL- Your email for Let's Encrypt certificatesSURFSHARK_USERNAMEandSURFSHARK_PASSWORD- If using VPN
Note: The
.envfile stays in the repository folder (~/AI-Homelab/.env). The deploy script copies it to stack directories automatically. Authelia secrets (JWT, session, encryption key) are auto-generated by the setup script - leave them with default values for now. -
Run the setup script:
sudo ./scripts/setup-homelab.shThe script will:
- Update system packages
- Install Docker Engine + Compose V2 (if needed)
- Configure user groups (docker, sudo)
- Set up firewall (UFW)
- Enable SSH server
- Generate Authelia secrets (JWT, session, encryption key)
- Prompt for admin username, password, and email
- Generate argon2id password hash (30-60 seconds)
- Create
/opt/stacks/directory structure - Set up Docker networks (homelab, traefik, dockerproxy, media)
- Detect NVIDIA GPU and offer driver installation
-
Log out and back in (or run
newgrp docker)Don't skip this step! Required for Docker group permissions.
-
Deploy homelab:
./scripts/deploy-homelab.shThe deploy script automatically:
- Creates Docker networks
- Configures Traefik with your email
- Generates Authelia admin password (saved to
/opt/stacks/core/authelia/ADMIN_PASSWORD.txt) - Deploys core stack (DuckDNS, Traefik, Authelia, Gluetun)
- Deploys infrastructure stack (Dockge, Pi-hole, monitoring)
- Deploys dashboards stack (Homepage, Homarr)
- Opens Dockge in your browser
Login credentials:
- Username:
admin(default username - or the custom username you specified during setup) - Password: The secure password you created when prompted by the setup script
That's it! Your homelab is ready. Access Dockge at https://dockge.yourdomain.duckdns.org
What the Setup Script Does
The setup-homelab.sh script is a comprehensive first-run configuration tool:
System Preparation:
- ✅ Pre-flight checks (internet connectivity, disk space 50GB+)
- ✅ Updates system packages
- ✅ Installs required packages (git, curl, etc.)
- ✅ Installs Docker Engine + Compose V2 (if not present)
- ✅ Configures user permissions (docker, sudo groups)
- ✅ Sets up firewall (UFW with SSH, HTTP, HTTPS)
- ✅ Enables SSH server
Authelia Configuration (Interactive):
- ✅ Generates three cryptographic secrets (JWT, session, encryption)
- ✅ Prompts for admin username (default: admin)
- ✅ Prompts for secure password with confirmation
- ✅ Prompts for admin email address
- ✅ Generates argon2id password hash using Docker (30-60s process)
- ✅ Validates Docker is available before password operations
- ✅ Saves credentials securely for deployment script
Infrastructure Setup:
- ✅ Creates directory structure (
/opt/stacks/) - ✅ Sets up Docker networks (homelab, traefik, dockerproxy, media)
- ✅ Detects NVIDIA GPU and offers driver installation
Safety Features:
- Skips completed steps (safe to re-run)
- Timeout handling (60s for Docker operations)
- Comprehensive error messages with troubleshooting hints
- Exit on critical failures with clear next steps
Manual Setup (Alternative)
If you prefer manual control or the automated script fails, see the Manual Setup Guide for step-by-step instructions on installing Docker, configuring services, and deploying the homelab manually.
Post-Setup Next Steps
Access Your Services
- Dockge:
https://dockge.yourdomain.duckdns.org - Authelia:
https://auth.yourdomain.duckdns.org - Traefik:
https://traefik.yourdomain.duckdns.org
Set Up 2FA with Authelia
- Access
https://auth.yourdomain.duckdns.org - Set up your admin user
- Configure 2FA for security
Deploy Additional Stacks
Use Dockge to deploy stacks like:
arr-apps.yml- Media management (Radarr, Sonarr, Prowlarr, etc.)media-servers.yml- Plex and Jellyfindownloaders.yml- qBittorrent, Transmission, etc.monitoring.yml- Uptime Kuma and metricssystem-tools.yml- Utility servicesautomation.yml- Automated workflows
Note: The dashboards stack (Homepage and Homarr) is already deployed during initial setup.
Set Up Homepage Widgets
- Access Homepage dashboard
- Get API keys from services
- Configure widgets in
/opt/stacks/dashboards/homepage/config/
VS Code Integration
- Install VS Code and GitHub Copilot
- Open the AI-Homelab repository
- Use AI assistance for:
- Adding new services
- Configuring Traefik routing
- Managing Docker stacks
Troubleshooting
Script Issues
- Permission denied: Run with
sudo - Docker not found: Log out/in or run
newgrp docker - Network conflicts: Check existing networks with
docker network ls
Service Issues
- Can't access services: Check Traefik dashboard at
https://traefik.yourdomain.duckdns.org - SSL certificate errors: Wait 2-5 minutes for wildcard certificate to be obtained from Let's Encrypt
- Check status:
python3 -c "import json; d=json.load(open('/opt/stacks/core/traefik/acme.json')); print(f'Certificates: {len(d[\"letsencrypt\"][\"Certificates\"])}')" - View logs:
docker exec traefik tail -50 /var/log/traefik/traefik.log | grep certificate
- Check status:
- Authelia login fails: Check user database configuration at
/opt/stacks/core/authelia/users_database.yml - "Not secure" warnings: Clear browser cache or wait for DNS propagation (up to 5 minutes)
- Check logs: Use Dozzle web interface at
https://dozzle.yourdomain.duckdns.orgor rundocker logs <container-name>
Common Fixes
# Restart Docker
sudo systemctl restart docker
# Check service logs
cd /opt/stacks/stack-name
docker compose logs -f
# Rebuild service
docker compose up -d --build service-name
Next Steps
- Explore services through Dockge
- Configure backups with Backrest/Duplicati
- Set up monitoring with Grafana/Prometheus
- Add external services via Traefik proxying
- Use AI assistance for custom configurations
Happy homelabbing! 🚀