This article contains affiliate links. If you purchase through our links, we may earn a commission at no extra cost to you. We only recommend products we’ve thoroughly researched and verified.

Nextcloud on a mini PC gives your household a full Google Drive replacement — file sync, photo backup, calendar, contacts, office document editing, and video conferencing — running entirely on your hardware at home. No subscription, no data leaving your network.
This guide installs Nextcloud via Docker Compose with Nginx reverse proxy and SSL, ready for local and remote access.
Before You Start
Requirements:
- Mini PC running Ubuntu Server 24.04 or Debian 12
- Docker and Docker Compose installed
- At least 8GB RAM 16GB recommended for multiple users + other services
- External storage mounted at
/mnt/dataUSB HDD, NAS, or additional SSD - Domain name or dynamic DNS hostname for HTTPS/remote access
- Optional: Cloudflare account for Tunnels simplifies remote HTTPS
Estimated time: 60-90 minutes
Step 1: Install Docker
# Install Docker CE
curl -fsSL https://get.docker.com | sh
sudo usermod -aG docker $USER
newgrp docker
# Install Docker Compose plugin
sudo apt install -y docker-compose-plugin
docker compose version # Verify
Step 2: Mount External Storage
Nextcloud data should live on external storage, not the internal NVMe which stores the OS and Docker volumes.
# Find your external drive
lsblk
# Example output: sda — 480G (your USB HDD or external SSD)
# Create mount point
sudo mkdir -p /mnt/data
# Get UUID for fstab permanent mount
sudo blkid /dev/sda1
# Example: UUID="a1b2c3d4-e5f6-..."
# Add to /etc/fstab for auto-mount on boot
echo "UUID=a1b2c3d4-e5f6-... /mnt/data ext4 defaults,nofail 0 0" | sudo tee -a /etc/fstab
# Mount now
sudo mount -a
# Create Nextcloud data directory
sudo mkdir -p /mnt/data/nextcloud
sudo chown -R 33:33 /mnt/data/nextcloud # www-data user ID inside container
Step 3: Create Docker Compose Configuration
mkdir -p ~/nextcloud && cd ~/nextcloud
nano docker-compose.yml
version: "3.8"
services:
nextcloud-db:
image: mariadb:11
container_name: nextcloud-db
restart: unless-stopped
command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW
volumes:
- nextcloud_db:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=CHANGE_THIS_ROOT_PASS
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
- MYSQL_PASSWORD=CHANGE_THIS_DB_PASS
networks:
- nextcloud-net
nextcloud-redis:
image: redis:alpine
container_name: nextcloud-redis
restart: unless-stopped
networks:
- nextcloud-net
nextcloud:
image: nextcloud:29
container_name: nextcloud
restart: unless-stopped
depends_on:
- nextcloud-db
- nextcloud-redis
volumes:
- nextcloud_html:/var/www/html
- /mnt/data/nextcloud:/var/www/html/data # External storage for files
environment:
- MYSQL_HOST=nextcloud-db
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
- MYSQL_PASSWORD=CHANGE_THIS_DB_PASS
- REDIS_HOST=nextcloud-redis
- NEXTCLOUD_ADMIN_USER=admin
- NEXTCLOUD_ADMIN_PASSWORD=CHANGE_THIS_ADMIN_PASS
- NEXTCLOUD_TRUSTED_DOMAINS=YOUR_DOMAIN.com YOUR_LOCAL_IP
- PHP_MEMORY_LIMIT=1G
- PHP_UPLOAD_LIMIT=20G
networks:
- nextcloud-net
nextcloud-nginx:
image: nginx:alpine
container_name: nextcloud-nginx
restart: unless-stopped
depends_on:
- nextcloud
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ./ssl:/etc/nginx/ssl:ro
- nextcloud_html:/var/www/html:ro
networks:
- nextcloud-net
volumes:
nextcloud_db:
nextcloud_html:
networks:
nextcloud-net:
driver: bridge
Step 4: Create Nginx Configuration
nano nginx.conf
events {
worker_connections 1024;
}
http {
upstream nextcloud {
server nextcloud:80;
}
server {
listen 80;
server_name YOUR_DOMAIN.com;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl http2;
server_name YOUR_DOMAIN.com;
ssl_certificate /etc/nginx/ssl/fullchain.pem;
ssl_certificate_key /etc/nginx/ssl/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512;
ssl_prefer_server_ciphers on;
client_max_body_size 20G;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
location / {
proxy_pass http://nextcloud;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_buffering off;
proxy_request_buffering off;
# WebDAV support
proxy_set_header Destination $http_destination;
}
}
}
Step 5: Set Up SSL with Let’s Encrypt
Option A: Certbot requires port 80 open
# Install certbot
sudo apt install -y certbot
# Stop nginx temporarily for verification
docker compose stop nextcloud-nginx
# Get certificate
sudo certbot certonly --standalone -d YOUR_DOMAIN.com
# Copy certs
sudo mkdir -p ~/nextcloud/ssl
sudo cp /etc/letsencrypt/live/YOUR_DOMAIN.com/fullchain.pem ~/nextcloud/ssl/
sudo cp /etc/letsencrypt/live/YOUR_DOMAIN.com/privkey.pem ~/nextcloud/ssl/
sudo chmod 644 ~/nextcloud/ssl/*.pem
Option B: Cloudflare Tunnel no port forward needed
# Install cloudflared
curl -L https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb -o cloudflared.deb
sudo dpkg -i cloudflared.deb
# Login and create tunnel
cloudflared login
cloudflared tunnel create nextcloud
cloudflared tunnel route dns nextcloud YOUR_DOMAIN.com
# Config file at ~/.cloudflared/config.yml:
# tunnel: TUNNEL_ID
# credentials-file: /home/USER/.cloudflared/TUNNEL_ID.json
# ingress:
# - hostname: YOUR_DOMAIN.com
# service: http://localhost:80
# - service: http_status:404
# Run as service
sudo cloudflared service install
sudo systemctl start cloudflared
With Cloudflare Tunnel: Nextcloud is accessible at https://YOUR_DOMAIN.com without opening any router ports. Cloudflare handles SSL termination.
Step 6: Start Nextcloud
cd ~/nextcloud
docker compose up -d
# Follow startup logs
docker compose logs -f nextcloud
Initial startup takes 2-3 minutes. Access Nextcloud at https://YOUR_DOMAIN.com or http://YOUR_LOCAL_IP.
Step 7: Post-Installation Configuration
Run Nextcloud Cron
Background jobs must run regularly for file scanning and notifications:
# Add crontab entry for Nextcloud background tasks
echo "*/5 * * * * docker exec nextcloud php -f /var/www/html/cron.php" | crontab -
Configure Redis for File Locking
Verify Redis is working prevents file sync conflicts:
docker exec -it nextcloud php occ config:system:get memcache.locking
# Should return: \OC\Memcache\Redis
If not configured, set it:
docker exec -it nextcloud php occ config:system:set memcache.local --value='\OC\Memcache\Redis'
docker exec -it nextcloud php occ config:system:set memcache.locking --value='\OC\Memcache\Redis'
docker exec -it nextcloud php occ config:system:set redis host --value='nextcloud-redis'
docker exec -it nextcloud php occ config:system:set redis port --value='6379'
Enable Nextcloud Office
For collaborative document editing alternative to Google Docs:
# In Nextcloud web UI:
# Apps → Office & Text → Nextcloud Office → Download and enable
# Or install Collabora Online if you want a separate document server
Storage Layout Recommendations
/dev/nvme0n1 (internal, 256-500GB)
├── / (OS — 30GB)
├── /opt/docker (Docker volumes — MariaDB, Nextcloud config: 20-50GB)
└── /tmp (ephemeral)
/dev/sda (external USB HDD or SSD — 1-4TB)
└── /mnt/data/nextcloud (actual file storage — all user files)
Never store actual Nextcloud user files on the same drive as the OS. If the OS NVMe fails and is replaced, the user data on external storage survives intact — just remount and start the container stack again.
Performance on Common Mini PCs
| Mini PC | Users Supported | Sync Speed LAN | RAM Used | Idle Power |
|---|---|---|---|---|
| Beelink MINI S12 | 2-4 | ~50-80 MB/s | ~2-3GB | ~6W |
| Beelink EQ14 | 4-10 | ~80-100 MB/s | ~3-4GB | ~7W |
| GEEKOM IT12 | 10-20 | ~100 MB/s | ~4-6GB | ~12W |
LAN sync speed is limited by the USB HDD write speed ~80-120 MB/s or NVMe speed ~500+ MB/s — not the CPU.
Backup Strategy
# Daily automated backup of Nextcloud data and database
cat > ~/nextcloud/backup.sh << 'EOF'
#!/bin/bash
BACKUP_DIR="/mnt/backup/nextcloud"
DATE=$(date +%Y-%m-%d)
mkdir -p "$BACKUP_DIR/$DATE"
# Database dump
docker exec nextcloud-db mysqldump -uroot -pROOT_PASS nextcloud > "$BACKUP_DIR/$DATE/db.sql"
# Config backup (not user files — those are already on external storage)
cp -r /opt/docker/nextcloud_html/config "$BACKUP_DIR/$DATE/"
# Remove backups older than 14 days
find "$BACKUP_DIR" -maxdepth 1 -type d -mtime +14 -exec rm -rf {} \;
echo "Backup complete: $DATE"
EOF
chmod +x ~/nextcloud/backup.sh
# Add to crontab: 0 2 * * * /home/USER/nextcloud/backup.sh
Who Should Skip This Comparison
Frequently Asked Questions
Can I use Nextcloud instead of Google Photos?
Yes. The Nextcloud Photos app and mobile client auto-upload photos from your phone on Wi-Fi — functionally identical to Google Photos for backup. The Memories app adds facial recognition and timeline view. Storage is your hardware — no 15GB free tier limit.
How do I upgrade Nextcloud?
With Docker, upgrades are straightforward:
cd ~/nextcloud
docker compose pull nextcloud
docker compose up -d
docker exec -it nextcloud php occ upgrade
Always backup the database before major version upgrades.
Why is Nextcloud slow for remote users?
Remote access speed is limited by your home upload bandwidth, not the mini PC. A 50Mbps upload connection delivers ~6MB/s to remote users. For faster remote access: upgrade to a higher upload ISP tier or use Nextcloud’s End-to-End Encryption with a hosted sync service like Hetzner Storage Box as the backend for remote files.
Can I run Nextcloud in a Proxmox LXC?
Yes. Create a privileged Ubuntu LXC container in Proxmox, assign 2-4 cores and 4-8GB RAM, and follow this same Docker setup inside the container. The container approach keeps Nextcloud isolated from your Proxmox host and makes snapshots and migration easy.
What mini PC specs do I need for Nextcloud?
Nextcloud needs 2GB RAM minimum for the server, PHP-FPM, and database. 4-8GB is comfortable. A 4-core CPU handles multiple simultaneous users. Storage is the real requirement — plan 1-2TB of external or NAS storage for a family file server. Any modern mini PC from $110 upward handles Nextcloud well.
Should I use Docker or bare-metal Nextcloud on a mini PC?
Docker Compose is recommended for mini PC Nextcloud deployments. It separates the Nextcloud, database, Redis, and Nginx containers cleanly, makes upgrades simple pull new image, restart, and makes backup and migration easy. Bare-metal installs require manual PHP version management and are harder to migrate.
Is Nextcloud as fast as Google Drive on a local network?
Faster for local transfers. On a gigabit LAN, Nextcloud sync transfers at 60-100MB/s — limited by storage write speed, not the server. Google Drive is limited by internet speed and Google’s server load. Remote access over the internet is slower than Google Drive since your home upload speed becomes the bottleneck.
