feat: Add Nextcloud service to homelab setup

This commit is contained in:
2025-11-15 23:36:26 +02:00
parent 7ad966014e
commit 26f0d7f5f4
4 changed files with 48 additions and 6 deletions

View File

@@ -6,6 +6,7 @@ This repository contains the configuration for my personal homelab stack, includ
|---------|-------------|------------| |---------|-------------|------------|
| **Vaultwarden** | Self-hosted password manager (Bitwarden-compatible) | `https://vault.example.com` | | **Vaultwarden** | Self-hosted password manager (Bitwarden-compatible) | `https://vault.example.com` |
| **2FAuth** | Self-hosted two-factor authentication manager | `https://auth.example.com` | | **2FAuth** | Self-hosted two-factor authentication manager | `https://auth.example.com` |
| **Nextcloud** | Self-hosted file hosting service | `https://storage.example.com` |
| **Caddy** | Reverse proxy with automatic HTTPS via DuckDNS (DNS-01) | *No direct UI* | | **Caddy** | Reverse proxy with automatic HTTPS via DuckDNS (DNS-01) | *No direct UI* |
| **Portainer** | Makes Docker life 100x easier (visual container manager) | `https://<SERVER_IP>:9443` | | **Portainer** | Makes Docker life 100x easier (visual container manager) | `https://<SERVER_IP>:9443` |
| **Uptime Kuma** | Monitors homelab/domain uptime | `http://<SERVER_IP>:3001` | | **Uptime Kuma** | Monitors homelab/domain uptime | `http://<SERVER_IP>:3001` |
@@ -33,9 +34,11 @@ Before deploying, you **must** replace all placeholder values in the config file
- `https://vault.example.com` and `vault.example.com` → your Vaultwarden domain - `https://vault.example.com` and `vault.example.com` → your Vaultwarden domain
- `https://auth.example.com` and `auth.example.com` → your 2FAuth domain - `https://auth.example.com` and `auth.example.com` → your 2FAuth domain
- `https://storage.example.com` and `storage.example.com` → your Nextcloud domain
- `admin@example.com` → your email address (used by Caddy / Lets Encrypt and 2FAuth) - `admin@example.com` → your email address (used by Caddy / Lets Encrypt and 2FAuth)
- `TOKEN` → your DuckDNS token - `TOKEN` → your DuckDNS token
- `SomeRandomStringOf32CharsExactly` → a **32-character** random string for `APP_KEY` - `SomeRandomStringOf32CharsExactly` → a **32-character** random string for `APP_KEY`
- `NEXTCLOUD_ADMIN_USER` and `NEXTCLOUD_ADMIN_PASSWORD` → your Nextcloud admin credentials
## DuckDNS Dynamic DNS Updater ## DuckDNS Dynamic DNS Updater
@@ -68,10 +71,11 @@ This ensures your DuckDNS domains always point to your current IP.
The **homelab/** folder contains: The **homelab/** folder contains:
- `compose.yml` runs Vaultwarden, 2FAuth, and Caddy - `compose.yml` spins up Docker containers
- `Caddyfile` defines routing for: - `Caddyfile` defines routing for:
- `https://<vault-domain>` → Vaultwarden - `https://<vault-domain>` → Vaultwarden
- `https://<auth-domain>` → 2FAuth - `https://<auth-domain>` → 2FAuth
- `https://<storage-domain>` → Nextcloud
### Start the stack ### Start the stack
@@ -79,6 +83,7 @@ The **homelab/** folder contains:
cd homelab cd homelab
mkdir -p services/vaultwarden \ mkdir -p services/vaultwarden \
services/2fauth \ services/2fauth \
services/nextcloud \
services/uptimekuma \ services/uptimekuma \
services/portainer \ services/portainer \
services/caddy/config \ services/caddy/config \
@@ -99,9 +104,7 @@ docker compose down
### View logs ### View logs
```bash ```bash
docker logs caddy -f docker logs <container> -f
docker logs vaultwarden -f
docker logs 2fauth -f
``` ```
### Auto-start on system boot ### Auto-start on system boot
@@ -132,7 +135,7 @@ Then restart the containers:
```bash ```bash
cd homelab cd homelab
docker compose restart vaultwarden 2fauth portainer dozzle uptime-kuma netdata docker compose restart vaultwarden 2fauth nextcloud portainer dozzle uptime-kuma netdata
``` ```
## Updating ## Updating

View File

@@ -2,7 +2,7 @@
# === CONFIGURATION === # === CONFIGURATION ===
TOKEN="TOKEN" TOKEN="TOKEN"
DOMAINS=("auth" "vault") DOMAINS=("auth" "vault" "storage")
LOG_DIR="$(cd "$(dirname "$0")" && pwd)" LOG_DIR="$(cd "$(dirname "$0")" && pwd)"
LOG_FILE="$LOG_DIR/duck.log" LOG_FILE="$LOG_DIR/duck.log"

View File

@@ -39,3 +39,26 @@
reverse_proxy 2fauth:8000 reverse_proxy 2fauth:8000
} }
# ===========================
# Nextcloud
# ===========================
{$STORAGE_DOMAIN} {
log {
level INFO
output file {$LOG_FILE} {
roll_size 10MB
roll_keep 10
}
}
tls {
dns duckdns {$DUCKDNS_TOKEN}
}
encode zstd gzip
reverse_proxy nextcloud:80
}

View File

@@ -35,6 +35,21 @@ services:
networks: networks:
- default - default
# ==========================
# Nextcloud (Personal cloud / NAS)
# ==========================
nextcloud:
image: nextcloud:latest
container_name: nextcloud
restart: always
volumes:
- ./services/nextcloud:/var/www/html
environment:
- NEXTCLOUD_ADMIN_USER=admin # Change to yours
- NEXTCLOUD_ADMIN_PASSWORD=changeme # Change to a strong password
networks:
- default
# ========================== # ==========================
# Caddy (Reverse proxy) # Caddy (Reverse proxy)
# ========================== # ==========================
@@ -55,6 +70,7 @@ services:
# For Caddy: hostnames only, no https:// # For Caddy: hostnames only, no https://
VAULT_DOMAIN: "vault.example.com" # Change to yours VAULT_DOMAIN: "vault.example.com" # Change to yours
AUTH_DOMAIN: "auth.example.com" # Change to yours AUTH_DOMAIN: "auth.example.com" # Change to yours
STORAGE_DOMAIN: "storage.example.com" # Change to yours
EMAIL: "admin@example.com" # Change to yours EMAIL: "admin@example.com" # Change to yours
DUCKDNS_TOKEN: "TOKEN" # Change to yours DUCKDNS_TOKEN: "TOKEN" # Change to yours
LOG_FILE: "/data/access.log" LOG_FILE: "/data/access.log"