NextcloudPI: Self-Hosted Cloud on a Raspberry Pi
Want your own cloud storage but don't have a full server? NextcloudPI runs a complete Nextcloud instance on a Raspberry Pi. Perfect for low-power, always-on personal cloud storage.
What is NextcloudPI?
NextcloudPI (NCP) is:
- Pre-configured Nextcloud - Works out of the box
- Optimized for Pi - Tuned for ARM and limited resources
- Easy management - Web UI and CLI tools
- Automated backups - Built-in backup solutions
- Security hardened - SSL, firewall, fail2ban included
Hardware Requirements
Minimum:
- Raspberry Pi 3B+ or Pi 4
- 2GB+ RAM (4GB recommended)
- microSD card (32GB+)
- Ethernet or WiFi
Recommended:
- Raspberry Pi 4 4GB or 8GB
- USB 3.0 SSD (boot from SSD)
- Ethernet connection
- Case with cooling
Installation Methods
Method 1: Flash Image (Easiest)
- Download NextcloudPI image from nextcloudpi.com
- Flash to SD card with Raspberry Pi Imager
- Insert and boot
- Access web interface
Method 2: Install Script
On a fresh Raspberry Pi OS:
curl -sSL https://raw.githubusercontent.com/nextcloud/nextcloudpi/master/install.sh | sudo bash
This takes 30-60 minutes on a Pi 4.
First-Time Setup
- Find your Pi's IP address (check router or use
nmap) - Access
https://YOUR-PI-IP:4443(ncp-web interface) - Note the generated passwords
- Complete the setup wizard
Activate Nextcloud
In ncp-web:
- Navigate to Nextcloud → nc-admin
- Set admin password
- Enable additional features
ncp-config vs ncp-web
| Tool | Access | Best For |
|---|---|---|
| ncp-web | Browser :4443 | General configuration |
| ncp-config | SSH/Terminal | Advanced settings |
# Terminal interface
sudo ncp-config
Essential Configuration
Enable External Storage
For USB drives:
- ncp-web → USB Configuration → nc-automount
- Plug in USB drive
- It auto-mounts at
/media/USBdrive
Expand Data Directory
Move data to external storage:
- ncp-web → CONFIG → nc-datadir
- Set new path (e.g.,
/media/USBdrive/ncdata) - Wait for migration
Enable SSL
Already included! Access via HTTPS on port 443 or 4443.
For Let's Encrypt:
- ncp-web → CONFIG → letsencrypt
- Enter your domain
- Enable
Backup Configuration
Local Backup
# ncp-web → BACKUPS → nc-backup
Backs up:
- Nextcloud database
- Data files
- Configuration
Automatic Backups
Schedule in ncp-web → BACKUPS → nc-backup-auto:
- Daily at 2 AM
- Keep 7 days
- Store on external drive
Performance Tuning
Enable Memory Caching
Already configured! But verify Redis is running:
sudo systemctl status redis-server
Use SSD Boot
- Flash NCP to SSD
- Update bootloader for USB boot
- Connect SSD to USB 3.0 port
10x speed improvement over SD card!
Disable Features You Don't Use
In Nextcloud → Apps, disable:
- Activity (if not needed)
- First Run Wizard
- Weather Status
Accessing Remotely
Option 1: Port Forwarding
Forward ports 80 and 443 to your Pi. Requires static IP or DDNS.
Option 2: Tailscale (Recommended)
curl -fsSL https://tailscale.com/install.sh | sh
sudo tailscale up
Access from anywhere without port forwarding!
Option 3: Cloudflare Tunnel
Free tunneling without exposing ports:
cloudflared tunnel create nextcloud
Mobile Apps
Install Nextcloud app:
- iOS: App Store
- Android: Play Store or F-Droid
Enable auto-upload for photos to replace Google Photos!
Troubleshooting
Slow Performance
- Check SD card speed (Class 10 minimum)
- Use SSD instead
- Reduce concurrent users
- Enable caching
Can't Access Web Interface
# Check services
sudo systemctl status apache2
sudo systemctl status mariadb
# Restart if needed
sudo systemctl restart apache2
Database Errors
# Repair database
sudo -u www-data php /var/www/nextcloud/occ maintenance:repair
Alternatives
If NextcloudPI doesn't fit your needs:
- Docker on Pi - More flexibility, more setup
- DietPi with Nextcloud - Ultra-minimal base
- Synology/QNAP - Off-the-shelf NAS
Learn More
Running Nextcloud on a Pi? Share your experience on Discord!
