Nextcloud AIO: Your Own Google Drive on a VPS with Docker
The Problem: Your Files Live on Someone Else's Terms
Photos, work documents, and family archives — chances are they're scattered across a few free services: one account already full, another nearly there, all of them free to change the rules at any moment. Free tiers get cut, prices go up, features move behind a paywall. Your files sit on someone else's server, under someone else's rules.
Nextcloud fixes that: open-source cloud storage you run on your own VPS. You decide the capacity, you hold the data, and there's no advertising or content scanning for a third party's benefit. The AIO (All-in-One) edition makes it far easier to install than a manual setup, because the whole stack — app, database, cache, backups — is managed from a single interface.
Why AIO Instead of a Manual Install
A manual Nextcloud install means assembling everything yourself: a web server, PHP, a PostgreSQL or MariaDB database, Redis for caching and file locking, then cron for background jobs. It all works — but every component becomes your responsibility the moment something stops fitting together.
Nextcloud AIO wraps all of that in one "mastercontainer" that acts as the control center. It downloads, runs, and updates the other containers: Nextcloud itself, PostgreSQL, Redis, plus optional components you tick as needed — Collabora for editing documents in the browser, ClamAV for antivirus scanning, Imaginary for image previews, Fulltextsearch for searching document contents, and BorgBackup for encrypted backups. Updates and backups are handled from the same interface, not five different places.
What you need: one Ubuntu VPS with Docker and Docker Compose already installed, plus one domain (for example cloud.yourdomain.com) pointing at the VPS IP. As for size, the rule of thumb is simple — the more users and files you serve, the more RAM and disk you'll want. Leave room to grow; don't install on a VPS that's already cramped.
Step 1: Run the Mastercontainer
AIO offers two install routes: direct (the mastercontainer holds ports 80, 8080, and 8443 — 8080 for the self-signed admin interface, 8443 for one with a valid certificate) or behind a reverse proxy. Since this blog already uses Nginx as a reverse proxy, this article uses the second route: the mastercontainer runs behind Nginx, and only the admin interface port is exposed.
Create a working directory and a docker-compose.yml file:
mkdir -p ~/nextcloud-aio
cd ~/nextcloud-aioservices:
nextcloud-aio-mastercontainer:
image: ghcr.io/nextcloud-releases/all-in-one:latest
init: true
restart: always
container_name: nextcloud-aio-mastercontainer
volumes:
- nextcloud_aio_mastercontainer:/mnt/docker-aio-config
- /var/run/docker.sock:/var/run/docker.sock:ro
ports:
- 127.0.0.1:8080:8080
environment:
APACHE_PORT: 11000
APACHE_IP_BINDING: 127.0.0.1
volumes:
nextcloud_aio_mastercontainer:
name: nextcloud_aio_mastercontainerTwo lines you must not change: container_name has to stay nextcloud-aio-mastercontainer, and the volume has to stay named nextcloud_aio_mastercontainer. AIO recognizes its installation through those two names; changing them breaks the built-in backups and updates. The APACHE_PORT variable shifts the Nextcloud app port to 11000, and APACHE_IP_BINDING ties it to localhost only — meaning the app can't be reached directly from the internet, only through Nginx later.
Run it:
docker compose up -d
docker compose logs -f nextcloud-aio-mastercontainerIn those logs you'll find the initial passphrase for the AIO interface. Copy it into a password manager — this passphrase is the admin key to the whole installation.
Step 2: Open the AIO Interface and Pick Components
The AIO interface runs on port 8080 with a self-signed certificate. Since that port is bound to localhost, reach it through an SSH tunnel from your own computer:
ssh -L 8080:127.0.0.1:8080 user@YOUR-VPS-IPThen open https://localhost:8080 in your browser and enter the passphrase from the log. The browser will warn about the self-signed certificate — that's normal for local admin access like this, and you can proceed once you've checked you're actually connected to your own server.
In the AIO interface, enter your Nextcloud domain, then tick only the optional components you genuinely need. The principle: don't tick everything just because it's there. Every component adds RAM load and maintenance surface. To start, the most useful are usually Collabora (edit documents in the browser) and the built-in backup. ClamAV is worth adding if many people upload files to your server; Fulltextsearch only matters once your document archive is large and searched often.
Click to start the containers. This takes a few minutes because AIO downloads all the required images — wait until every container shows green in the interface before moving on.
Step 3: Secure It with Nginx and HTTPS
Now point your domain at the app. Create an Nginx configuration for your Nextcloud domain:
server {
listen 80;
server_name cloud.yourdomain.com;
location / {
proxy_pass http://127.0.0.1:11000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
client_max_body_size 512M;
}
}Enable it and secure it with a Let's Encrypt certificate:
sudo ln -s /etc/nginx/sites-available/nextcloud /etc/nginx/sites-enabled/
sudo nginx -t && sudo systemctl reload nginx
sudo certbot --nginx -d cloud.yourdomain.comOpen https://cloud.yourdomain.com, create the first Nextcloud admin account, and store the credentials in a password manager. From this point on, the cloud storage is fully yours: upload files from the browser or the Nextcloud desktop and mobile apps, share via password-protected links with expiry dates, and edit documents right in the browser if Collabora is active.
Common Traps to Avoid
Domain not pointing yet during validation. Make sure the domain's DNS record already points at the VPS IP before you finish setup in the AIO interface. Failed domain validation is the most common reason installations loop at the first step.
App port open to the public. Port 11000 is deliberately bound to 127.0.0.1. Don't turn it into a public port — the only user-facing entry point should be Nginx over HTTPS.
Renaming the container or volume. As stressed above, AIO depends on the name nextcloud-aio-mastercontainer for backups and updates. Renaming it means the installation is no longer recognized correctly.
Forgetting backups. AIO has a Backup section in its interface (based on BorgBackup). Enable it and point backup output somewhere outside the VPS — a backup stored on the same machine won't help when that VPS itself is the problem. Also schedule Docker volume backups following your VPS backup guide.
Enabling every component at once. Each optional container is one more thing to update, monitor, and potentially break. Add components when you actually need them, not up front.
Comparison: AIO vs Manual Install vs Cloud Service
| Aspect | Nextcloud AIO | Manual install | Free cloud service |
|---|---|---|---|
| Initial install time | One compose file + wizard | Assemble web server, PHP, database yourself | Zero, just sign up |
| Updates | From the AIO interface | Per component, manual | Automatic, no control for you |
| Backups | Integrated (BorgBackup) | You design it yourself | Depends on the service plan |
| Control over data | Full, on your server | Full, on your server | Limited, provider rules apply |
| Cost | VPS cost only | VPS cost only | Free up to a limit, then subscription |
| Maintenance burden | Low | High | Zero, but no control |
Checklist Before You Finish
- Mastercontainer running, container and volume names unchanged
- AIO interface reachable via tunnel, passphrase stored safely
- Domain pointed at the VPS and entered in the AIO interface
- All chosen containers showing green
- Nginx forwarding the domain to port 11000 with HTTPS active
- Nextcloud admin account created, credentials in a password manager
- AIO Backup section active, backup output stored outside the VPS
- Nextcloud mobile and desktop apps connected, sync tested
Once this setup is done, your files come home to your own server — your domain, your rules, and backups you control.
How many GB of files would you want to move off Google Drive? Tell us in the comments — your answers could shape a follow-up article on migrating from cloud services to Nextcloud.
Read also: One VPS, Many Services: Nginx Reverse Proxy and Let's Encrypt · Automatic, Encrypted VPS Backups to Google Drive · Docker Volumes and Backups: Don't Lose Your Data
Note: this guide is based on the official Nextcloud AIO project documentation; adapt it to the version you install and double-check commands before running them on a production server.


Komentar
Posting Komentar