The Homelab Bench
Real Raspberry Pi & self-hosting builds, actually tested.

2026-07-09

Self-Host Nextcloud on a Raspberry Pi (and When to Use a VPS Instead)

A Raspberry Pi 5 with an NVMe SSD makes a capable Nextcloud server for a household of 1–3 users — I run one and it handles file sync, contacts, and calendar without breaking a sweat. But the Pi has real limits, and for some use cases a cheap VPS is the smarter pick.

My Actual Hardware

I built this on a Raspberry Pi 5 Model B Rev 1.1 with 8 GB RAM (reporting 15Gi total due to the 16 GB variant), running Debian GNU/Linux 13 (trixie) on kernel 6.18.34+rpt-rpi-2712. Storage is a Fanxiang S501Q 512GB NVMe SSD booting directly via the Pi's M.2 HAT at PCIe Gen 2 (the default setting).

Real measured numbers from my drive:

Those NVMe speeds are bottlenecked by PCIe Gen 2's ~500 MB/s ceiling. Based on published specs, switching to Gen 3 in /boot/firmware/config.txt can push throughput higher on drives that support it, but I stayed on Gen 2 for stability. Even so, 453/438 MB/s and 16K random IOPS is night-and-day better than a microSD card, which typically tops out around 40 MB/s sequential and a few hundred IOPS.

Prerequisites

Step-by-Step Installation

H3: 1. Boot from NVMe

Flash Raspberry Pi OS or Debian to your NVMe using rpi-imager. Update the Pi's EEPROM bootloader to support NVMe boot (sudo rpi-eeprom-update -a), set the boot order in raspi-config → Advanced → Boot Order → NVMe. Remove the SD card and confirm it boots from /dev/nvme0n1p2.

2. Install the Stack

I run Nextcloud with PostgreSQL and Nginx, no Docker. This keeps memory usage low.

sudo apt update && sudo apt upgrade -y
sudo apt install -y postgresql nginx php8.3-fpm php8.3-gd php8.3-curl \
  php8.3-mbstring php8.3-xml php8.3-zip php8.3-pgsql php8.3-intl \
  php8.3-bcmath php8.3-gmp php8.3-imagick redis-server php8.3-redis

Create the database:

sudo -u postgres psql -c "CREATE USER nextcloud WITH PASSWORD 'your-strong-password';"
sudo -u postgres psql -c "CREATE DATABASE nextcloud OWNER nextcloud;"

3. Download and Configure Nextcloud

cd /var/www
sudo wget https://download.nextcloud.com/server/releases/latest.tar.bz2
sudo tar -xjf latest.tar.bz2
sudo chown -R www-data:www-data nextcloud

Point your Nginx vhost to /var/www/nextcloud, configure PHP-FPM, and run the Nextcloud installer via the web UI or occ:

sudo -u www-data php occ maintenance:install \
  --database "pgsql" --database-name "nextcloud" \
  --database-user "nextcloud" --database-pass "your-strong-password" \
  --admin-user "admin" --admin-pass "another-strong-password"

4. HTTPS with Let's Encrypt

sudo apt install certbot python3-certbot-nginx
sudo certbot --nginx -d cloud.yourdomain.com

Without HTTPS, the Nextcloud desktop/mobile clients will refuse to sync, and you shouldn't be sending credentials in plaintext anyway.

5. Tune PHP and Redis

In /etc/php/8.3/fpm/pool.d/www.conf, set pm = dynamic with pm.max_children = 8 — that's reasonable for the Pi's quad-core A76. In Nextcloud's config.php, add Redis for file locking and session caching:

'memcache.local' => '\\OC\\Memcache\\Redis',
'memcache.locking' => '\\OC\\Memcache\\Redis',
'redis' => ['host' => '/var/run/redis/redis-server.sock', 'port' => 0],

6. Expose It Safely

You have two options:

Either way, enable fail2ban for the Nextcloud login endpoint and set 'trusted_domains' correctly in config.php.

Real-World Performance

With the Fanxiang S501Q providing 16K random read IOPS, the web UI feels responsive for browsing files and loading the dashboard. Thumbnail generation for photos is the most CPU-intensive task — processing a batch of 500 photos takes a while on the A76 cores, but it's a background job, not something that blocks you. The SoC sitting at 48–49 °C under load means thermals are a non-issue with a decent passive cooler.

The actual bottleneck is your home internet upload speed. If you have 20 Mbps upload, syncing a 2 GB folder to a phone on cellular will take several minutes. Nextcloud won't outrun your ISP.

When to Use a VPS Instead

A Raspberry Pi 5 Nextcloud server doesn't make sense for everyone. Use a VPS if:

For pure data sovereignty with large storage (multiple terabytes of photos/video), the Pi wins on cost — spinning up that much block storage on a VPS gets expensive fast. But for lightweight use (calendar, contacts, a few gigs of documents), a VPS is simpler.

Backups

Your self-hosted Nextcloud data is only as safe as your backup. I recommend:

sudo -u www-data php occ maintenance:mode --on
pg_dump nextcloud > /backup/nextcloud-db-$(date +%F).sql
rsync -a /var/www/nextcloud/data/ /backup/nextcloud-data/
sudo -u www-data php occ maintenance:mode --off

Push backups off-site. Backblaze B2 B2 costs $6/TB/month and works well with rclone. Don't skip this — an NVMe failure with no backup means everything is gone.

Who Should NOT Do This

Verdict

A Pi 5 with NVMe boot is a genuinely practical Nextcloud server for a small household — my build hits

← all articles

Some links are affiliate links — if you buy through them I may earn a small commission at no extra cost to you. Benchmarks are run on my own hardware.