addedd a install script and a redme file

This commit is contained in:
2026-01-21 16:00:16 +00:00
parent 0d2b5203ba
commit 627e9ca241
2 changed files with 120 additions and 0 deletions
+62
View File
@@ -0,0 +1,62 @@
============================================================ MILES' HOME SERVER STACK README
This repository contains a fully automated, containerized home server stack. It uses Docker for containerization, Caddy for reverse proxying, and is optimized for access via Tailscale.
QUICK START (NEW SYSTEM)
If you are setting this up on a fresh install, follow these three steps:
Step 1: Prepare the Script Run: chmod +x setup.sh
Step 2: Run the Setup Run: ./setup.sh (This will install Docker if missing, create all required folders in /home/miles/, and set correct permissions.)
Step 3: Launch Choose "Option 1" from the script menu to pull the images and start the services.
SERVICE MAP & NAVIGATION
All services are accessible via: http://raspberrypi.tail46eacb.ts.net:4533 (or your local IP)
SERVICE | PATH | FUNCTION ---------------|---------|---------------------------------- Homarr | / | Central Dashboard (Landing Page) Code-Server | /edit | VS Code Web IDE Gitea | /git | Private Git Server Navidrome | /music | Music Streaming RomM | /roms | Retro Game Manager Trilium | /notes | Knowledge Base / Notes Excalidraw | /draw | Digital Whiteboard qBittorrent | /tr | Download Manager ntfy | /ntfy | Push Notifications
DIRECTORY STRUCTURE
The setup.sh script automatically manages these paths:
CONFIGS: /home/miles/code-config, /home/miles/qbittorrent-config
DATA: /home/miles/gitea-data, /home/miles/trilium-data, /home/miles/homarr-data
MEDIA: /home/miles/navidrome-music, /home/miles/roms, /home/miles/downloads
MAINTENANCE VIA SETUP.SH
Run ./setup.sh at any time to access the management menu:
Update Apps: Option 4 pulls the latest versions and restarts.
Check Status: Option 5 shows which containers are running.
Logs: Option 3 is vital for debugging startup issues.
TROUBLESHOOTING GUIDE
[A] Permissions Issues If a container won't start or says "Access Denied": Fix: sudo chown -R 1000:1000 /home/miles/
[B] Caddy Routing Problems If you see a "404" or "Blank Page" on a sub-path:
Ensure container names in Caddyfile match docker-compose.yml.
Run: docker exec -it caddy caddy validate --config /etc/caddy/Caddyfile
[C] Database Locks If an app hangs (Gitea/Trilium), it may have a database lock. Fix: docker compose restart [service-name]
[D] Networking Conflicts If port 4533 is in use, Caddy will fail. Check: sudo netstat -tulpn | grep 4533
IMPORTANT NOTES
WATCHTOWER: Runs in the background to auto-update apps.
SECURITY: Change the code-server password in docker-compose.yml.
TAILSCALE: Must be "Connected" for the Gitea URL to work.
============================================================
+58
View File
@@ -0,0 +1,58 @@
#!/bin/bash
# --- CONFIGURATION ---
BASE_DIR="/home/miles"
# List of folders to create based on your docker-compose
FOLDERS=(
"code-config" "projects" "homarr-data" "navidrome-data"
"navidrome-music" "trilium-data" "gitea-data" "roms"
"romm-data" "ntfy-cache" "qbittorrent-config" "downloads"
)
# --- 1. INSTALL DOCKER ---
if ! [ -x "$(command -v docker)" ]; then
echo "🚀 Docker not found. Installing..."
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo usermod -aG docker $USER
echo "✅ Docker installed. (Note: You may need to logout and back in for group changes to take effect)"
else
echo "✅ Docker is already installed."
fi
# --- 2. CREATE FOLDERS ---
echo "📂 Creating directory structure..."
for folder in "${FOLDERS[@]}"; do
mkdir -p "$BASE_DIR/$folder"
done
# Set permissions to PUID 1000
sudo chown -R $USER:$USER $BASE_DIR/
echo "✅ Folders created and permissions set to user $USER."
# --- 3. MANAGEMENT MENU ---
show_menu() {
echo "------------------------------------------"
echo " HOME SERVER MANAGEMENT MENU"
echo "------------------------------------------"
echo "1) Start/Update Stack (Up -d)"
echo "2) Stop Stack (Down)"
echo "3) View Logs (Follow)"
echo "4) Update Images (Pull)"
echo "5) Check Container Status"
echo "6) Exit"
echo "------------------------------------------"
}
while true; do
show_menu
read -p "Choose an option [1-6]: " choice
case $choice in
1) docker compose up -d ;;
2) docker compose down ;;
3) docker compose logs -f --tail=50 ;;
4) docker compose pull && docker compose up -d ;;
5) docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}" ;;
6) exit 0 ;;
*) echo "Invalid option. Try again." ;;
esac
done