
Complete Nextcloud setup guide with Docker Compose for 2026. Replace Google Drive with a self-hosted cloud on an Intel N100 mini PC. Includes Redis caching, MariaDB, and remote access via Tailscale.

Google Drive raised prices again in late 2025. Google One's 2TB plan now runs $9.99/month โ that is $120/year for storage you don't control, on hardware you don't own, subject to account terminations you can't appeal. For anyone with more than 1TB of data, the costs compound quickly.
Nextcloud is the most mature self-hosted cloud storage platform available. It replaces Google Drive, Google Docs collaboration, Google Calendar, and Google Contacts in a single deployment. As one community member put it on r/selfhosted:
"Self-hosting is not a hobby anymore, it's a legitimate alternative to Big Tech subscriptions. Nextcloud handles my 4TB of files, contacts, and calendar sync across 5 devices without issue." โ r/selfhosted
And when someone asks what the best Google Drive alternative is:
"I already know the answer is NextCloud but I thought I'd ask anyway" โ r/selfhosted
This guide covers a production-ready Nextcloud 30+ deployment using Docker Compose on an Intel N100 mini PC. You get a complete stack โ Nextcloud, MariaDB, and Redis โ with proper volume mounts, environment configuration, and performance tuning. No Apache, no manual PHP installs, no dependency hell.

The break-even point for self-hosting is faster than most people expect. An Intel N100 mini PC costs $150โ200 new, draws 6โ10W at idle, and can run Nextcloud plus a dozen other services simultaneously.
| Storage Tier | Google One (Annual) | Self-Hosted (Year 1) | Self-Hosted (Year 2+) |
|---|---|---|---|
| 1TB | $24/yr (100GB: $24, upgrades stack) | ~$180 hardware + $15 power | ~$15/yr (power only) |
| 2TB | $120/yr | ~$200 hardware + $15 power | ~$15/yr |
| 5TB | $250/yr (requires 2TB + add-ons) | ~$250 hardware + $25 power | ~$25/yr |
| 10TB | ~$500/yr | ~$300 hardware + $35 power | ~$35/yr |
Power cost assumes 8W average draw at $0.12/kWh. Hardware costs include an N100 mini PC and sufficient storage drives. By year two, self-hosting is 85โ95% cheaper at every tier above 1TB.
This doesn't account for the additional services running on the same hardware: Immich for photos (see Immich Self-Hosted Photos Guide), media servers, home automation, and network tools all share the same idle power budget.

A nextcloud self hosted deployment on an N100 mini PC is a well-proven configuration in the homelab community as of 2026.
| Spec | Value |
|---|---|
| CPU | Intel N100 (4 cores, Alder Lake-N) |
| Idle Power | 6โ10W |
| RAM | 16GB DDR4/DDR5 (8GB minimum) |
| OS Drive | 256GB NVMe |
| Data Drive | 1โ4TB HDD or NVMe depending on library size |
| Price (2026) | $150โ220 new, $90โ140 used |
The N100 handles Nextcloud's PHP-FPM workers, Redis, and MariaDB without thermal throttling. You will not saturate it with a typical family or small-team deployment (under 10 active users).
For detailed hardware comparison and purchasing advice, see Best Low-Power Mini PCs 2026.
This is the core of the guide. The following docker-compose.yml deploys a complete nextcloud docker compose stack: Nextcloud 30, MariaDB 11, and Redis 7.
Install Docker Engine and the Compose plugin:
# Debian/Ubuntu
curl -fsSL https://get.docker.com | sh
sudo usermod -aG docker $USER
newgrp docker
# Verify
docker compose version
mkdir -p /opt/nextcloud/{data,db,redis}
cd /opt/nextcloud
services:
db:
image: mariadb:11
container_name: nextcloud-db
restart: unless-stopped
command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW
volumes:
- ./db:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
networks:
- nextcloud-net
redis:
image: redis:7-alpine
container_name: nextcloud-redis
restart: unless-stopped
volumes:
- ./redis:/data
networks:
- nextcloud-net
app:
image: nextcloud:30
container_name: nextcloud-app
restart: unless-stopped
ports:
- "8080:80"
volumes:
- ./data:/var/www/html
environment:
- MYSQL_HOST=db
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- REDIS_HOST=redis
- NEXTCLOUD_ADMIN_USER=${NEXTCLOUD_ADMIN_USER}
- NEXTCLOUD_ADMIN_PASSWORD=${NEXTCLOUD_ADMIN_PASSWORD}
- NEXTCLOUD_TRUSTED_DOMAINS=${NEXTCLOUD_TRUSTED_DOMAINS}
- PHP_MEMORY_LIMIT=512M
- PHP_UPLOAD_LIMIT=2G
depends_on:
- db
- redis
networks:
- nextcloud-net
networks:
nextcloud-net:
driver: bridge
Create /opt/nextcloud/.env:
# Database
MYSQL_ROOT_PASSWORD=change-this-root-password
MYSQL_PASSWORD=change-this-db-password
# Nextcloud admin
NEXTCLOUD_ADMIN_USER=admin
NEXTCLOUD_ADMIN_PASSWORD=change-this-admin-password
# Trusted domains (comma-separated, no spaces)
# Add your LAN IP, hostname, or domain
NEXTCLOUD_TRUSTED_DOMAINS=192.168.1.100 nextcloud.yourdomain.com
Set restrictive permissions on .env:
chmod 600 /opt/nextcloud/.env
cd /opt/nextcloud
docker compose up -d
# Watch logs during first boot (database initialization takes 30-60 seconds)
docker compose logs -f app
Once you see Apache configured in the app logs, Nextcloud is accessible at http://<your-server-ip>:8080.
The first browser visit to port 8080 completes the installation wizard automatically using the environment variables you set. No manual database configuration is required.
After login, run the mandatory post-install steps via occ (Nextcloud's CLI):
# Add missing indices (speeds up queries after first run)
docker exec -u www-data nextcloud-app php occ db:add-missing-indices
# Convert columns to bigint (required for large file counts)
docker exec -u www-data nextcloud-app php occ db:convert-filecache-bigint --no-interaction
# Verify no configuration warnings remain
docker exec -u www-data nextcloud-app php occ status
Nextcloud requires a background job runner. The default AJAX cron is unreliable. Set up a system cron instead:
# Add to host crontab
(crontab -l 2>/dev/null; echo "*/5 * * * * docker exec -u www-data nextcloud-app php -f /var/www/html/cron.php") | crontab -
# Switch Nextcloud to use system cron
docker exec -u www-data nextcloud-app php occ background:cron
The Docker Compose stack connects Nextcloud to Redis automatically via the REDIS_HOST environment variable. Verify Redis is active:
docker exec -u www-data nextcloud-app php occ config:system:get memcache.local
# Should return: \OC\Memcache\Redis
docker exec nextcloud-redis redis-cli info stats | grep keyspace
Redis handles file locking and local memory caching. Community reports consistently show 40% reduction in database load after enabling Redis, which translates directly to faster file listing and login times.
The nextcloud:30 image includes OPcache. Verify it's active and tune the limits for better performance:
# Check OPcache status
docker exec nextcloud-app php -r "print_r(opcache_get_status(false));" | grep -E "enabled|memory_used|hit_rate"
To increase OPcache memory, add this to your docker-compose.yml under the app service environment:
environment:
- PHP_OPCACHE_MEMORY_CONSUMPTION=128
- PHP_OPCACHE_INTERNED_STRINGS_BUFFER=16
- PHP_OPCACHE_MAX_ACCELERATED_FILES=10000
The PHP_UPLOAD_LIMIT=2G environment variable is already set in the Compose file. For files larger than 2GB, use the Nextcloud desktop sync client or WebDAV chunked uploads, which bypass the PHP upload limit entirely.
Running Nextcloud on your LAN is useful. Running it from anywhere without exposing ports to the internet is essential for most setups.
Two options are well-supported and covered in detail at Tailscale vs Cloudflare Tunnels:
Tailscale (recommended for personal use)
# Install on your server
curl -fsSL https://tailscale.com/install.sh | sh
sudo tailscale up
# Nextcloud will be at http://<tailscale-ip>:8080
# Add the Tailscale IP to NEXTCLOUD_TRUSTED_DOMAINS in .env, then restart
docker compose restart app
Reverse proxy with HTTPS (recommended for shared/team use)
If you want a proper domain with TLS, add a Caddy or Nginx Proxy Manager container to the Compose stack and configure a domain. Caddy handles Let's Encrypt certificate renewal automatically:
caddy:
image: caddy:2-alpine
container_name: nextcloud-caddy
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
- caddy_data:/data
- caddy_certs:/config
networks:
- nextcloud-net
volumes:
caddy_data:
caddy_certs:
Caddyfile:
nextcloud.yourdomain.com {
reverse_proxy nextcloud-app:80
header {
Strict-Transport-Security "max-age=31536000;"
}
}
Docker volumes are not automatically backed up. The ./data and ./db directories in /opt/nextcloud contain everything. Losing these means losing all files and user data.
At minimum, implement the following:
# Stop Nextcloud for a consistent database snapshot
docker compose stop app
# Dump the database
docker exec nextcloud-db mysqldump -u nextcloud -p${MYSQL_PASSWORD} nextcloud > /backup/nextcloud-db-$(date +%F).sql
# Archive the data volume (exclude cache)
tar --exclude='./data/nextcloud/data/*/cache' \
--exclude='./data/nextcloud/data/*/thumbnails' \
-czf /backup/nextcloud-data-$(date +%F).tar.gz ./data
# Restart
docker compose start app
For a complete, automated, offsite backup system covering this and all your other Docker services, see 3-2-1 Backup Strategy. That guide covers BorgBackup with encrypted offsite copies, automated systemd timers, and restore testing procedures.
The selfhosted community has years of Nextcloud experience across hardware ranging from Raspberry Pi to dedicated servers.
A user on r/selfhosted running Nextcloud on an N100 mini PC:
"Nextcloud on N100 with 16GB RAM idles at about 8W. I've got 2TB of family files syncing across 6 devices. The desktop client just works. Zero issues in 8 months." โ r/selfhosted
On moving from Google Drive:
"Migrated 1.2TB from Google Drive to Nextcloud last year. The rclone migration took overnight but it worked perfectly. Haven't paid Google a cent since." โ r/selfhosted
On the Docker approach specifically:
"The AIO (All-In-One) image is fine but I prefer the manual Docker Compose approach. More control, easier to debug, easier to back up individual volumes." โ r/selfhosted
Nextcloud's file sync is also frequently compared to Syncthing. The consensus: Syncthing is simpler but peer-to-peer only; Nextcloud gives you a server with web access, sharing, calendar, contacts, and app plugins at the cost of more moving parts to maintain.
Common issues in a Docker Compose nextcloud setup guide 2026 context:
| Problem | Likely Cause | Fix |
|---|---|---|
504 Gateway Timeout on large uploads | PHP upload limit | Check PHP_UPLOAD_LIMIT env var, restart app container |
Cannot connect to database on first start | DB not ready before app | Run docker compose restart app after DB initializes |
Trusted domain error in browser | IP not in trusted domains | Add your IP to NEXTCLOUD_TRUSTED_DOMAINS in .env, restart app |
| Missing indices warning in admin panel | Post-install step skipped | Run docker exec -u www-data nextcloud-app php occ db:add-missing-indices |
| Files not syncing from desktop client | Cron not running | Verify crontab entry with crontab -l, check background:cron mode |
| Redis connection refused | Wrong network config | Confirm both services are on nextcloud-net, check REDIS_HOST=redis |
504 after Nextcloud update | PHP workers restarting | Wait 60 seconds and reload; check docker compose logs app |
| Slow file listing for large directories | Missing OPcache or no Redis | Verify OPcache enabled and Redis memcache.local config is set |
For permission errors on the data volume, the Nextcloud container runs as www-data (UID 33). If you pre-populate the data directory, set ownership:
sudo chown -R 33:33 /opt/nextcloud/data
The nextcloud docker compose approach in 2026 is substantially more maintainable than the older Apache-based installation methods. Updates reduce to docker compose pull && docker compose up -d. Rollbacks are straightforward with volume snapshots. The entire stack is described in two files.
On an N100 mini PC, Nextcloud sits at 6โ10W idle, handles multi-user sync without complaint, and costs under $20/year to run after the initial hardware purchase. At the 2TB tier, that is a 90%+ reduction in storage costs compared to Google One.
If you are replacing Google Photos as well as Google Drive, deploy Immich alongside Nextcloud โ see Immich Self-Hosted Photos Guide. Both services run comfortably on the same N100 hardware.

Builds
Complete docker-compose.yml to run Jellyfin, Nextcloud, Home Assistant, Pi-hole, Vaultwarden, Immich, Homepage, Uptime Kuma, Tailscale, and Portainer on an Intel N100 mini PC under 15W.
Use Cases
Compare the best home server dashboards in 2026: Homepage, Homarr, and Dashy. Resource usage on Intel N100, Docker setup, and which dashboard to choose for your homelab.

Use Cases
Best hardware for Home Assistant in 2026. Run HA on an Intel N100 mini PC at 8-12W idle. Covers HA OS bare metal, Proxmox LXC, and Docker Compose installation methods.
Check out our build guides to get started with hardware.
View Build Guides