← Self-Hosting · Files & Photos · Replaces: Google Drive, Dropbox, OneDrive, iCloud Drive
What You'll Build
Nextcloud is a complete, private cloud: sync folders between computers and phones, share links, and keep your calendar and contacts on your own server. The official All-in-One (AIO) image installs and updates Nextcloud and everything it needs (database, cache, optional office suite) for you.
Ports: 8080 (AIO admin), 11000 (Nextcloud behind the proxy) · RAM: 2–4 GB · Time: 45 minutes · Difficulty: Hard
What You Need
- Your home server from Foundations 1 (Docker installed,
~/stacksfolder). - Nginx Proxy Manager with your
*.home.example.comcertificate — required for this app. - A folder with plenty of space for your files, e.g.
/mnt/data/nextcloud.
Step 1: Create the AIO Compose File
mkdir -p ~/stacks/nextcloud && cd ~/stacks/nextcloud
sudo mkdir -p /mnt/data/nextcloud
nano compose.yaml
services:
nextcloud-aio-mastercontainer:
image: ghcr.io/nextcloud-releases/all-in-one:latest
init: true
restart: always
container_name: nextcloud-aio-mastercontainer # AIO requires this exact name
ports:
- "8080:8080" # AIO admin interface
environment:
APACHE_PORT: 11000 # Nextcloud listens here for the reverse proxy
APACHE_IP_BINDING: 0.0.0.0
SKIP_DOMAIN_VALIDATION: "true" # our domain is private (LAN/Tailscale only)
NEXTCLOUD_DATADIR: /mnt/data/nextcloud # where your files are stored
volumes:
- nextcloud_aio_mastercontainer:/mnt/docker-aio-config
- /var/run/docker.sock:/var/run/docker.sock:ro # AIO starts the other containers
volumes:
nextcloud_aio_mastercontainer:
name: nextcloud_aio_mastercontainer # AIO requires this exact name too
docker compose up -d
The AIO "mastercontainer" is a manager: it creates and updates the real Nextcloud containers itself. That's why it needs the Docker socket, and why you won't see them in this compose file.
Step 2: Add the Proxy Host First
In Nginx Proxy Manager, create cloud.home.example.com → http, 192.168.1.50, port 11000, Websockets on, wildcard certificate, Force SSL. In the Advanced tab paste:
# Allow large uploads and long transfers through the proxy
client_max_body_size 0;
proxy_read_timeout 86400s;
proxy_request_buffering off;
Step 3: Run the AIO Setup
- Open
https://192.168.1.50:8080(accept the self-signed certificate warning). - Copy the passphrase it shows into your password manager, then click Open Nextcloud AIO login and paste it.
- Enter your domain:
cloud.home.example.com→ Submit. - Choose optional containers. Good starting picks: Imaginary (faster previews) and Collabora (edit Word/Excel files in the browser, ~1 GB extra RAM). Skip Talk and ClamAV for now.
- Set your time zone → Download and start containers. This takes 5–15 minutes.
- When everything is green, AIO shows the initial admin username and password. Save them, then click Open your Nextcloud.
Step 4: Connect Your Devices
| Device | App | What to do |
|---|---|---|
| Windows / macOS / Linux | Nextcloud Desktop | Server address https://cloud.home.example.com, log in in the browser, pick folders to sync. |
| Android / iPhone | Nextcloud | Log in the same way. Turn on Auto upload only if you're not using Immich for photos. |
| Calendar & contacts (Android) | DAVx⁵ | Log in with your Nextcloud address to sync calendars and contacts to the phone's built-in apps. |
| Calendar & contacts (iPhone/Mac) | Built-in | Settings → Calendar → Accounts → Add → Other → CalDAV. Server: cloud.home.example.com. |
For each device, create an app password (Personal settings → Security) instead of using your main password — you can revoke it if the device is lost.
Step 5: Built-In Backups and Updates
- Backups: in the AIO interface, set a backup location (e.g.
/mnt/backup/nextcloud-aio) and a daily schedule. AIO uses BorgBackup and can restore a whole instance. - Updates: AIO updates Nextcloud and all its containers itself during the daily backup window, or when you click Start and update containers.
- Also add
/mnt/data/nextcloudto your resticEXTRAlist for a second, off-site copy.
Troubleshooting
- Domain check fails in AIO — make sure
SKIP_DOMAIN_VALIDATIONis set, thendocker compose up -dagain. - "Access through untrusted domain" — you're opening Nextcloud with a different address from the one entered in AIO. Use
cloud.home.example.com. - 502 Bad Gateway — the Nextcloud containers aren't started yet (check the AIO page), or the proxy points at 8080 instead of 11000.
- Uploads fail on big files — the Advanced-tab lines in Step 2 are missing.
- Changed NEXTCLOUD_DATADIR after setup — it can only be set before the first install. Start over by removing the AIO containers and volumes.
What's Next?
Nextcloud can store photos, but for a real Google Photos replacement use a dedicated app:
Immich: Your Own Google Photos →