Nextcloud gives you Google Drive/Dropbox functionality on hardware you control. Your data stays on your server, in your country, under your rules. Here is how to set it up.
Why Self-Hosted Cloud Storage
- Privacy - No third-party has access to your files
- Data sovereignty - Your files stay in the datacenter of your choice
- No storage limits - Limited only by your VPS disk space
- Full feature set - Calendar, contacts, notes, office docs, video calls
- No subscription fees - Just your VPS cost
Requirements
- VPS with at least 2GB RAM (4GB recommended)
- 50GB+ storage (depends on your needs)
- A domain name pointed to your VPS
Installation with Docker
The easiest production setup uses Docker Compose:
version: "3.8"
services:
nextcloud:
image: nextcloud:stable
restart: unless-stopped
volumes:
- nextcloud_data:/var/www/html
environment:
- MYSQL_HOST=db
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
depends_on:
- db
- redis
db:
image: mariadb:10.11
restart: unless-stopped
volumes:
- db_data:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
redis:
image: redis:7-alpine
restart: unless-stopped
nginx:
image: nginx:alpine
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- /etc/letsencrypt:/etc/letsencrypt:ro
depends_on:
- nextcloud
volumes:
nextcloud_data:
db_data:
SSL with Let's Encrypt
certbot certonly --standalone -d cloud.yourdomain.com
Configure Nginx to handle SSL termination and proxy to the Nextcloud container.
Performance Tuning
PHP Memory
Increase PHP memory limit in your Nextcloud config:
'memory_limit' => '512M',
Redis Caching
Redis dramatically improves Nextcloud performance. Add to config.php:
'memcache.local' => '\OC\Memcache\Redis',
'memcache.locking' => '\OC\Memcache\Redis',
'redis' => [
'host' => 'redis',
'port' => 6379,
],
Background Jobs
Switch from AJAX to cron for background tasks:
# Add crontab entry
*/5 * * * * docker exec -u www-data nextcloud php cron.php
Mobile and Desktop Sync
Nextcloud has official clients for:
- Desktop: Windows, macOS, Linux - auto-sync folders
- Mobile: iOS and Android - photo auto-upload, file access
- WebDAV: Compatible with any WebDAV client
Security
- Enable server-side encryption for files at rest
- Use two-factor authentication for all accounts
- Keep Nextcloud updated (updates are available through the admin panel)
- Configure your firewall to only allow HTTPS
- Regular backups of both the database and file storage
Storage Planning
| Use Case | Recommended Storage | |----------|-------------------| | Documents only | 50GB | | Documents + photos | 200GB | | Full cloud replacement | 500GB+ | | Team/family use | 1TB+ |
Choose a VPS plan with enough NVMe SSD storage for your needs. Space-Node's VPS plans include NVMe storage starting at 50GB.
Nextcloud is a complete Google Workspace alternative. Once set up, it requires minimal maintenance and gives you full control over your data.
