Nextcloud Proxmox Setup: The Best Free Google Drive Replacement
Almost everyone reaches a point where they get fed up with commercial cloud storage. Google Drive, Dropbox, and iCloud start out convenient, but before long, you hit the free 15 GB ceiling. Suddenly you are nagged with pop-ups telling you that your emails will stop sending unless you hand over $2.99 or $9.99 a month for extra gigabytes.
Beyond subscription fatigue, there is the privacy question: your photos, tax returns, contracts, and medical documents sit on someone else's computers, subject to algorithmic content scans and changes in terms of service.
The ultimate remedy is Nextcloud. When you self-host Nextcloud on your own hardware, storage is only limited by the size of the hard drives you plug in. There are no monthly subscription bills, and your files belong strictly to you.
In this guide, we will walk through setting up Nextcloud All-in-One (AIO) inside an Ubuntu LXC container on Proxmox, and exposing it securely over the internet using Cloudflare Tunnels—with zero open router ports and zero port forwarding headaches.
Why Nextcloud All-in-One (AIO) on Proxmox LXC?
Historically, installing Nextcloud was notoriously painful. You had to manually configure Apache or Nginx, install PHP and a dozen extensions, configure PostgreSQL or MariaDB, and tune Redis caching. If an update broke one PHP library, your entire cloud went offline.
Nextcloud AIO (All-in-One) completely changes this dynamic:
- Automated Stack: AIO packages Nextcloud, PostgreSQL, Redis, Apache, and optional tools (Collabora Office, Talk, ClamAV antivirus, and Imaginary for blazing-fast photo thumbnails) into clean, auto-updating Docker containers.
- One-Click Backups: It includes built-in BorgBackup integration right out of the box.
- LXC Efficiency: By running Docker inside an unprivileged Proxmox LXC container instead of a full virtual machine, you skip the heavy VM virtualization overhead. Your LXC shares the host Linux kernel and sips minimal CPU and RAM.
Step 1: Preparing the Proxmox Ubuntu LXC Container
Before running Docker inside an LXC, Proxmox needs permission to allow nested virtualization and keyctl support.
- In Proxmox VE, create a new Ubuntu 22.04 or 24.04 container (unprivileged).
- Allocate at least 2 to 4 CPU cores and 4 GB of RAM (Nextcloud performs much better with plenty of memory for Redis caching).
- Allocate your root disk size (e.g., 20 GB for the OS).
- Crucial Setting: Before booting the container, go to Options → Features, check both Nesting and keyctl, and click OK. (Alternatively, add
features: nesting=1,keyctl=1to/etc/pve/lxc/<ID>.conf). - Start the LXC container and log in as
root.
Now, install Docker and Docker Compose inside your LXC:
apt update && apt upgrade -y
apt install -y curl ca-certificates gnupg lsb-release
curl -fsSL https://get.docker.com | sh
systemctl enable --now docker
Step 2: Preparing Your Storage Directory
Nextcloud needs a place to store all your uploaded files, videos, and photos. Create the dedicated directory:
mkdir -p /data/ncdata
If you have a dedicated ZFS pool or an NFS share from a TrueNAS box, you can bind-mount that directory directly into /data/ncdata in your Proxmox container configuration.
Step 3: The Nextcloud AIO Docker Compose File
Create a folder for your Nextcloud project:
mkdir -p ~/nextcloud && cd ~/nextcloud
Create your docker-compose.yml file:
services:
nextcloud-aio-mastercontainer:
image: ghcr.io/nextcloud-releases/all-in-one:latest
container_name: nextcloud-aio-mastercontainer
restart: always
init: true
ports:
# Port 8080 is only needed on your local network to access the AIO setup dashboard
- "8080:8080"
environment:
- NEXTCLOUD_DATADIR=/data/ncdata
# Tells AIO to route Nextcloud web traffic to port 11000 instead of 443
- APACHE_PORT=11000
- APACHE_IP_BINDING=0.0.0.0
# Required for Cloudflare Tunnel to prevent domain-check failures
- SKIP_DOMAIN_VALIDATION=true
volumes:
- nextcloud_aio_mastercontainer:/mnt/docker-aio-config
- /var/run/docker.sock:/var/run/docker.sock:ro
volumes:
nextcloud_aio_mastercontainer:
name: nextcloud_aio_mastercontainer
Why These Environment Variables Matter:
ports: - "8080:8080": Exposes the AIO master setup wizard on your local network. You only use this port during initial setup and container updates.NEXTCLOUD_DATADIR=/data/ncdata: Tells Nextcloud where your raw files live on disk. This keeps your user data separate from the application container.APACHE_PORT=11000: Nextcloud AIO usually expects to handle SSL itself on port 443. However, because we are using a Cloudflare Tunnel, Cloudflare handles the public SSL certificate for us. We tell Nextcloud’s internal web server to listen on plain HTTP port11000.APACHE_IP_BINDING=0.0.0.0: Binds the Apache port across all network interfaces so Cloudflare Tunnel or local reverse proxies can reach it.SKIP_DOMAIN_VALIDATION=true: By default, the AIO setup wizard attempts to ping its own public domain over port 443 to test if your router has port forwarding open. Since Cloudflare Tunnels work outbound without open inbound router ports, that check would fail. Setting this variable tells AIO to trust our tunnel connection./var/run/docker.sock:/var/run/docker.sock:ro: Gives the master container read-only access to Docker so it can spin up and orchestrate the child containers (Postgres, Redis, Collabora) on demand.
Start the master container:
docker compose up -d
Step 4: Setting Up Cloudflare Tunnel Remote Routing
Instead of exposing your home IP address and forwarding ports 80 and 443 on your ISP router, we route traffic through a secure Cloudflare Zero Trust Tunnel.
- Go to the Cloudflare Zero Trust Dashboard (
one.dash.cloudflare.com). - Navigate to Networks → Tunnels.
- Select your active tunnel (or create a new one) and click Configure.
- Under the Public Hostname tab, click Add a public hostname.
- Configure the hostname settings:
- Subdomain:
drive(orcloud) - Domain: Your custom domain (e.g.,
yourhomelab.com) - Type:
HTTP - URL:
YOUR-LXC-IP:11000(orlocalhost:11000if the tunnel connector runs inside the same LXC)
- Subdomain:
- Under Additional application settings → HTTP Settings, increase HTTP2 Max Upload Size to prevent upload timeouts on large videos.
- Click Save hostname.
Cloudflare will immediately provision a valid SSL certificate and start routing public traffic from https://drive.yourdomain.com straight to port 11000 on your LXC.
Step 5: Completing the AIO Setup Wizard
Now, visit your local server IP in your browser on port 8080:
https://YOUR-LXC-IP:8080
Note: Your browser will warn you about a self-signed certificate on port 8080. Click Advanced → Proceed. This is expected for the local setup interface.
- The screen will display a long, randomized admin password. Copy this string and store it in your password manager immediately. You cannot recover this without resetting the container.
- Paste your password to log in.
- When asked for your domain, type the full public domain you set up in Cloudflare (e.g.,
drive.yourdomain.com). - Choose your optional add-on containers:
- Nextcloud Office (Collabora): Free in-browser document, spreadsheet, and presentation editing (similar to Google Docs).
- Imaginary: Highly recommended. Uses libvips to generate photo and thumbnail previews ten times faster than PHP GD.
- Nextcloud Talk: Private chat and video calling.
- Set your default timezone and click Download and start containers.
AIO will now pull the individual images and wire them together. This process typically takes 3 to 5 minutes depending on your internet connection. Once complete, you will be given your initial Nextcloud admin username and password.
Step 6: Syncing Your Phone and Desktop
Navigate to your public URL (e.g., https://drive.yourdomain.com) and log in. You now have a full, private cloud:
- Mobile App (iOS & Android): Install the official Nextcloud app, enter your domain, and turn on Auto Upload. Every photo and video you snap on your phone will automatically back up to your home server the moment you connect to Wi-Fi.
- Desktop Client (Windows, macOS, Linux): Install the desktop sync client. Select the folders you want synchronized locally, and use Virtual Files to save hard drive space on your laptop while keeping your entire archive accessible.
Why Self-Hosting Your Cloud Storage Wins
Let's put this into perspective:
| Feature | Google Drive / Commercial Cloud | Self-Hosted Nextcloud AIO |
|---|---|---|
| Cost | $24 to $120+ per year, perpetually increasing | $0 monthly fees. Pay once for hard drives |
| Storage Limits | 15 GB free, strict tiers thereafter | Unlimited (whatever drives your server holds) |
| Data Ownership | Data stored on corporate servers; scanned by algorithms | 100% private. Files live on physical disks in your home |
| Network Access | Dependent on external cloud uptime | Works over local LAN at gigabit speeds even if internet drops |
Maintenance and Backup Tips
Because your data is now your responsibility, follow these two backup habits:
- Enable AIO Built-in Backups: The AIO dashboard at port 8080 includes a daily automated BorgBackup scheduler. Point it to a separate secondary hard drive or remote NAS.
- Proxmox Backup Server (PBS) Snapshots: Set up a scheduled backup job in Proxmox to snapshot the entire LXC container every night. If an update ever fails, you can roll back your entire system in under 30 seconds.
Summary
Setting up Nextcloud on Proxmox with Cloudflare Tunnels gives you the ultimate self-hosted victory: enterprise-grade cloud storage, seamless mobile photo syncing, and full privacy—without paying a single monthly dime to big tech companies.