How to Host Your Own Cloud Storage with Nextcloud on a VPS
When you host your own cloud storage, your files live on a server you control instead of on someone else’s platform. Nextcloud turns a plain VPS into a private Dropbox-style service with file sync, sharing links, a web interface, and mobile apps. This guide walks through the full setup on a VPS, from picking the right server size to daily use, backups, and the limits you should know before you switch.
Nextcloud is free and open source. You still pay for the VPS, the domain, and the storage, and you take on the maintenance work that Google or Dropbox normally handle for you. That trade is worth it for many people: no monthly per-user fee, no scanning of your files for ads, and full control over where data sits.
Host Your Own Cloud Storage: What You Need Before You Start
Start with a VPS that has at least 2 GB of RAM and 2 CPU cores. Nextcloud runs on less, but the web interface and the database slow down fast once you add sync clients and a few users. For storage, pick a disk at least twice the size of the files you plan to store today, because Nextcloud keeps file versions and a trash bin that eat space over time. A 50 GB disk sounds large until you sync a photo library and a few shared folders.
You also need a domain name pointed at the VPS and a clean Ubuntu 24.04 install. A domain matters because the Nextcloud desktop and mobile apps need a stable HTTPS address. Set up a non-root user with sudo, enable the firewall, and install Docker before you touch Nextcloud itself. If you have not set up a server before, read our first 10 things to do after buying a VPS guide first.
Plan for backups from the start, not after your first scare. A VPS disk can fail, and a single copy of your files on one server is not a backup. Decide where the second copy will live, an object storage bucket or another server, before you upload anything important. Our guide to backing up a VPS to S3-compatible storage with Restic shows one low-cost way to keep that off-site copy current.
Install Nextcloud with Docker Compose and AIO
The simplest reliable path is Nextcloud All-in-One, or AIO, which ships Nextcloud, its database, and its supporting services as a set of Docker containers. You do not need to install PHP, a web server, or a database by hand. Install Docker and Docker Compose on the VPS first, then run the AIO container and open its setup page in your browser. For the step-by-step Docker setup, see our Nextcloud Docker Compose guide, which covers the compose file and the first-run screens in detail.
During setup, AIO asks for your domain, for example cloud.example.com, and creates an admin account. It also handles the TLS certificate for you, so the site serves HTTPS without a separate Certbot step. Keep the admin password in a password manager. If you lose it, recovery means digging through container logs and database commands, which is a slow way to learn that lesson.
A minimal compose file for AIO looks like this:
services:
nextcloud-aio-mastercontainer:
image: nextcloud/all-in-one:latest
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:
- "80:80"
- "8080:8080"
- "8443:8443"
volumes:
nextcloud_aio_mastercontainer:
Start it with docker compose up -d, then open https://your-server-ip:8080 and follow the AIO setup wizard. AIO then pulls the remaining containers, which takes a few minutes on a fresh VPS. When the wizard finishes, your Nextcloud is reachable at your domain. Check that the login page loads over HTTPS and that the admin account works before you invite anyone else.
Set Up Users, Folders, and Sync
After the install, create one user per person instead of sharing the admin account. Each user gets a home folder, a quota you set, and their own login for the desktop and mobile apps. Group folders work well for a family or a small team: create a group, add the users, and share a folder with the group so everyone sees the same files without passing links around.
Set quotas early. Without a quota, one user syncing a full photo library can fill the disk and stop the whole server. A quota of 10 to 20 GB per person is a sane start on a small VPS, and you can raise it later once you see real usage. Leave the trash bin enabled so a deleted file can come back.
Install the Nextcloud desktop client on each computer and point it at your domain. Pick the folders to sync and let the first sync finish before you judge speed. The first sync of a large library takes a while, since every file uploads once. Later syncs only move changed files, so they feel much faster. On phones, install the Nextcloud app and turn on auto-upload for the camera folder if you want photos backed up as you take them.
Daily Use: Sync, Share, and Mobile Access
Day to day, Nextcloud feels much like the big services. Files you drop in the synced folder appear on your other devices within seconds when both are online. The web interface handles uploads, downloads, previews, and text editing, and the built-in office apps open common document formats without downloading them first.
Sharing works through links with optional passwords and expiry dates. Set an expiry date on any link you send outside your household, and use a password for anything sensitive. You can also share a folder with another user on your server, which keeps the files in one place instead of copying them. Check the sharing list once a month and remove links you no longer need.
The mobile app covers the basics well: browse files, upload photos, and open documents. It is not as polished as the Google Drive or Dropbox apps, and large uploads over a slow mobile connection can stall and need a retry. For files you need offline, mark them as available offline before you leave Wi-Fi. If you run Nextcloud at home instead of on a VPS, the same apps apply, as our guide on running Nextcloud on a home server explains.
Backups and Updates You Cannot Skip
Self-hosted cloud storage only works if you treat backups and updates as part of the job. AIO includes a backup feature that exports the database and data directory. Schedule it to run at least weekly, and copy the backup off the VPS the same day. A backup that sits on the same disk as the files it protects is no help when that disk dies. Test a restore at least once on a spare directory, because an untested backup is a guess, not a plan.
Update Nextcloud through the AIO interface when it shows a new version, and update the host system with your package manager on the same day. Read the release notes before a major version jump, since some versions need a manual step. Never update right before you need the files, and never skip the backup that comes first.
Watch disk space and memory. Set up a simple alert or a weekly check of free space, because a full disk stops uploads and can corrupt the database. Pick a disk size with room to grow, and keep the off-site backup from the section above current.
Nextcloud vs Google Drive and Dropbox: Honest Limits
Nextcloud wins on control and cost at small scale. You pay a flat VPS price, roughly a few dollars a month for a small server (check official pricing), no matter how many users you add, and nobody mines your files for ads. You can add apps for notes, tasks, calendar, and contacts, turning one server into a small private workspace. If you already compare self-hosted file tools, our Nextcloud vs Syncthing vs Seafile comparison lays out how the three approaches differ in sync style and setup effort.
Google Drive and Dropbox win on polish, speed, and reliability. Their sync clients handle conflicts and large files better, their mobile apps are smoother, and their uptime is backed by teams far larger than one person. They also handle sharing with outsiders more smoothly, since most recipients already have an account.
Nextcloud also needs your time. Expect an hour or two a month for updates, checks, and the odd fix. When something breaks, you are the support team, and the fix may mean reading logs and forum posts. That is the real price of self-hosted cloud storage. If you enjoy that work, or you simply want your files on your own server, Nextcloud on a VPS is a solid choice. If you want storage that never asks anything of you, stick with a paid commercial plan and spend the VPS money elsewhere.