Google Drive costs $3–10/month for 200GB–2TB of cloud storage. Nextcloud on your own mini PC gives you unlimited storage (limited only by your drives), complete privacy (your files never touch anyone else’s servers), and a genuinely polished desktop and mobile experience — for the cost of the hardware you already own.
The installation has gotten significantly easier in recent years. Using Docker, you can have Nextcloud running in about 30 minutes without any web development experience. This guide covers the complete setup from scratch.
What You Need Before Starting
- A mini PC running Ubuntu Server 24.04 LTS, Debian, or a similar Linux distribution (TrueNAS users should use TrueNAS’s built-in app catalog instead)
- Docker and Docker Compose installed on the mini PC
- A static local IP for the mini PC (set via DHCP reservation in your router)
- Storage space: either the mini PC’s internal drive or an external HDD dock with shucked drives
- Optional: a domain name for remote access (you can use Nextcloud locally without one, but remote access requires it or a dynamic DNS service)
Step 1: Install Docker and Docker Compose
SSH into your mini PC (or open a terminal directly) and run:
curl -fsSL https://get.docker.com | sh
sudo usermod -aG docker $USER
sudo apt install docker-compose-plugin -y
Log out and back in for the group change to take effect. Verify with docker run hello-world — you should see a success message.
Step 2: Create the Docker Compose Configuration
Create a directory for Nextcloud and its compose file:
mkdir ~/nextcloud && cd ~/nextcloud
nano docker-compose.yml
Paste the following configuration (this is a production-ready setup using Nextcloud with MariaDB and Redis for better performance):
version: '3'
services:
nextcloud-db:
image: mariadb:10.11
restart: always
volumes:
- nc_db:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: changethispassword
MYSQL_DATABASE: nextcloud
MYSQL_USER: nextcloud
MYSQL_PASSWORD: changethispassword2
nextcloud-redis:
image: redis:alpine
restart: always
nextcloud:
image: nextcloud:stable
restart: always
ports:
- 8080:80
volumes:
- nc_data:/var/www/html
- /mnt/nas:/mnt/nas # Map your external storage here
environment:
MYSQL_HOST: nextcloud-db
MYSQL_DATABASE: nextcloud
MYSQL_USER: nextcloud
MYSQL_PASSWORD: changethispassword2
REDIS_HOST: nextcloud-redis
depends_on:
- nextcloud-db
- nextcloud-redis
volumes:
nc_db:
nc_data:
Replace the password values with strong passwords of your own. Change /mnt/nas to the actual path of your external storage — for a drive mounted at /mnt/storage, use that path. Save the file (Ctrl+X, Y, Enter in nano).
Step 3: Start Nextcloud
docker compose up -d
Docker downloads and starts all containers. This takes 2–5 minutes on first run depending on your connection speed. Check progress with docker compose logs -f nextcloud. Wait until you see “Apache/2.4.x configured” in the logs.
Step 4: Initial Setup
Open a browser on any computer on your network and navigate to http://[your-mini-pc-IP]:8080. The Nextcloud setup wizard appears. Create your admin username and password. On the database configuration screen, select MySQL/MariaDB and enter the credentials from your docker-compose.yml file.
Click “Install.” This takes 1–3 minutes. After completion, you’re dropped into your Nextcloud dashboard — a clean, functional personal cloud storage interface with a Files app, Calendar, Contacts, and more.
Step 5: Connect Your External Storage
In Nextcloud’s admin panel, navigate to Settings → Administration → External Storages. Add a new storage location pointing to the /mnt/nas path you mapped in docker-compose.yml. This makes your external HDD storage accessible through Nextcloud’s file manager — you can upload and browse files on your shucked drives through the same interface as your personal cloud.
Step 6: Install Mobile Apps
Nextcloud has official iOS and Android apps (free on both app stores). Enter your server URL (http://[local-IP]:8080) and credentials. The apps support automatic photo backup from your phone — a direct replacement for Google Photos, where your photos go to your own hardware instead of Google’s servers.
Remote Access Without a VPN
Nextcloud provides secure remote access through the Nextcloud Talk protocol, but the simplest approach for home users is to enable a reverse proxy through Cloudflare Tunnel or Nginx Proxy Manager — both can be installed as additional Docker containers. This allows you to access your Nextcloud at a custom domain (e.g., cloud.yourdomain.com) without exposing your home IP address or opening router ports.
Alternatively, run WireGuard VPN on the same mini PC and access Nextcloud through the VPN tunnel from anywhere — a more secure approach that requires establishing the VPN connection before accessing cloud storage.