How to Self Host Cloud Storage on a VPS (Nextcloud, Seafile, Syncthing)
Part of Self-hosting, our guide to this topic
To self host cloud storage, run Nextcloud on a small VPS if you want a Google Drive or Dropbox replacement with sync, a web interface and sharing links; pick Seafile if you mainly want fast, reliable file sync; pick plain Syncthing if you don’t need a web file view or sharing links at all. Run it on a VPS when you want your files off-site and reachable without opening ports on your home network — and accept the catch up front: VPS disk is small and expensive per terabyte, so you either buy a storage-heavy plan or add a block volume or storage box.
On this page
This guide has no affiliate links in the steps.
The honest trade-off is the same as every self-hosted app: you stop paying a subscription and become the update, uptime and backup department. That is exactly the deal with self hosting n8n. If you have never run a server, work through the new VPS setup checklist first — this box will hold files you don’t want to lose, and the checklist covers the SSH keys and firewall you need before any of them go on it.

Which self-hosted cloud storage should you run?
The short version, in the order most people should consider them:
- Nextcloud — a Dropbox / Google Drive replacement: file sync, a web interface, sharing links, plus calendar, contacts and many more apps. Nextcloud Office is available too, but it needs a separate Collabora server on top of this setup. It is the most complete option and the most work to keep running, so it is the default for most people.
- Seafile — file sync first. Its selling point is fast, dependable sync of a lot of files, with a web UI, sharing and a lightweight document editor (SeaDoc), but a smaller app ecosystem. Choose it when syncing files quickly is the whole point.
- Syncthing — no central server and no sharing links; it syncs folders peer-to-peer between your own devices, encrypted in transit. Its web page is for settings, not for browsing files. A VPS can still run it as an always-on copy that every device syncs with.
- ownCloud Infinite Scale — a Go rewrite of ownCloud, the project Nextcloud forked from. It keeps file metadata on disk, so there is no separate database to run. A valid alternative when you want files plus a web UI with fewer moving parts.
| Tool | What it does | RAM (project docs) | Official apps | Database | Licence |
|---|---|---|---|---|---|
| Nextcloud | Sync, web UI, sharing, apps | 512 MB per process (128 MB min) | iOS, Android, desktop | MariaDB/MySQL or PostgreSQL | AGPLv3 |
| Seafile Community | Fast sync, web UI, sharing | 2 GB, 2 cores | iOS, Android, desktop | MariaDB/MySQL (bundled) | AGPLv3; Pro is paid |
| ownCloud Infinite Scale | Sync, web UI, sharing | 4 GB (512 MB to test) | iOS, Android, desktop | None | Apache 2.0 |
| Syncthing | Device-to-device sync, no web file UI | Not stated | Desktop; phones via community apps | None | MPL 2.0 |
Nextcloud also runs on SQLite, but its docs say that is for testing only.
The RAM column quotes each project’s own documentation, read on Nov 20, 2026, not a measurement by us. Nextcloud’s figure is per PHP process, so a real server needs a lot more than 128 MB. A 2 GB VPS is our sizing for a small Nextcloud with its database, and it is also Seafile’s own stated minimum.
Nextcloud’s memory figures are per process, not for the whole server. Source: docs.nextcloud.com, captured Nov 20, 2026.
Seafile Community Edition asks for 2 GB of RAM, so it is not the lighter option. Source: manual.seafile.com, captured Nov 20, 2026.
File Browser no longer gets security fixes. Source: github.com/filebrowser/filebrowser, captured Nov 20, 2026.
When not to self-host. Self-hosting cloud storage is a second job: updates, a reverse proxy, HTTPS certificates, backups and restores are all on you. If you won’t keep up with those, stay on a hosted service — a self-hosted mail server is the same kind of commitment. The single-point-of-failure worry is real too; the trade-offs section below covers it.
What a storage-heavy VPS costs
Disk, not CPU, is the expensive part of self-hosting files. A general-purpose VPS gives you tens of gigabytes of SSD, so the cheapest way to hold a lot of files is a plan built around disk. Three plans from our data, all read daily, with the billing terms spelled out:
| Plan | Specs and price | Best for | Catch |
|---|---|---|---|
| HostHatch Storage 1TB | 1 vCPU, 1 GB RAM, 1 TB hard disk, $5.00/month | Most disk for the money (up to 10 TB) | Slow disks, 1 GB RAM: better as a Syncthing node or backup |
| Contabo Cloud VPS 6 | 6 vCPU, 12 GB RAM, 200 GB SSD, $9.00/month | Nextcloud and its database on one box | Excl. VAT; location surcharge; no refunds |
| netcup VPS 1000 G12.5 | 4 vCPU, 8 GB RAM, 128 GB SSD, $15.17/month | A comfortable Nextcloud | Excl. VAT + location surcharge; minimum term; ID check |
HostHatch also refunds only with a valid reason and wipes unpaid servers after 5 days. netcup may ask for ID verification or a prepayment after your first order.
HostHatch’s storage line is the clear disk-for-money pick, as long as you accept hard disks and a small amount of RAM. The “A VPS for this guide” table further down lists the cheapest 2 GB plan at each provider whose prices we read ourselves. To compare every plan by real monthly cost, compare VPS prices.
HostHatch’s storage plans run on hard disks, with 1 GB of RAM on the 1 TB plan. Source: hosthatch.com, captured Nov 20, 2026.
If one VPS disk is not enough, some providers also sell block volumes you attach as a second disk, or storage boxes you mount over the network (Hetzner’s Storage Box, for example). We do not read those prices daily, so check the provider’s own page rather than trusting a number here. And expect the cheap disk to come with shared resources:
Shared networking. Unstable speed as you are contending with others on the same port - all providers tend to overallocate to cover cost here
Self host Nextcloud on Ubuntu 24.04: 7 steps
The commands below follow the official Nextcloud Docker image and its Compose example, with Caddy in front for HTTPS and MariaDB for the database. Replace YOUR_DOMAIN and the other orange words with your own values. Nextcloud runs on its own subdomain, such as cloud.example.com.
Point a subdomain at your server
At your DNS provider, add an A record named cloud that points to YOUR_SERVER_IP. Do this first — Caddy can only get a certificate once the name resolves to your server.
servergetent hosts cloud.YOUR_DOMAIN
Check: Your server’s IP next to the name. If nothing prints, wait a few minutes and try again.
Install Docker
Use Docker’s own repository so you get a current version plus the Compose plugin. Our Docker on Ubuntu guide walks through the whole install; the short version is the two checks below.
serversudo docker run hello-world
sudo docker compose version
Create the project folder and the .env file
The .env file holds the two database passwords. Generate them, write them down somewhere safe, and keep the file locked down.
serversudo mkdir -p /opt/nextcloud/caddy_config
cd /opt/nextcloud
sudo nano .env
fileMYSQL_ROOT_PASSWORD=YOUR_ROOT_PASSWORD
MYSQL_PASSWORD=YOUR_NEXTCLOUD_DB_PASSWORD
Then sudo chmod 600 / so other users on the box can’t read the passwords.
Write the Docker Compose file
serversudo nano /opt/nextcloud/compose.yaml
serverservices:
caddy:
image: caddy:2
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- caddy_data:/data
- ./caddy_config/Caddyfile:/etc/caddy/Caddyfile:ro
db:
image: mariadb:11.4
container_name: nextcloud-db
restart: unless-stopped
command: --transaction-isolation=READ-COMMITTED
volumes:
- db_data:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
MYSQL_DATABASE: nextcloud
MYSQL_USER: nextcloud
app:
image: nextcloud:stable-apache
container_name: nextcloud-app
restart: unless-stopped
depends_on:
- db
volumes:
- nextcloud_data:/var/www/html
environment:
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
MYSQL_DATABASE: nextcloud
MYSQL_USER: nextcloud
MYSQL_HOST: db
NEXTCLOUD_TRUSTED_DOMAINS: cloud.YOUR_DOMAIN
OVERWRITEPROTOCOL: https
ports:
- "127.0.0.1:8080:80"
volumes:
caddy_data:
db_data:
nextcloud_data:
What matters here:
NEXTCLOUD_TRUSTED_DOMAINSis the list of hostnames Nextcloud is allowed to answer on. With Caddy in front, the request arrives at Nextcloud with your real domain, so the domain must be on that list or you get a “trusted domain” error.OVERWRITEPROTOCOL: httpstells Nextcloud the visitor is on HTTPS even though Caddy talks to it over plain HTTP inside the server, so the links and redirects it generates start withhttps:/./ 127.0.0.1:8080binds Nextcloud to the server only. Docker-published ports bypass ufw, so a plain8080:80would be open to the internet; Caddy reaches Nextcloud over Docker’s internal network either way.nextcloud_datais the whole/folder — the app, your config and, invar/ www/ html data/, your files. The database lives separately indb_data.mariadb:11.4is one of the MariaDB versions on Nextcloud’s supported list; the official example uses the floatingmariadb:ltstag instead.
Configure Caddy for HTTPS
serversudo nano /opt/nextcloud/caddy_config/Caddyfile
Caddyfile — nanocloud.YOUR_DOMAIN {
reverse_proxy app:80
}
app:80 is the service name from the compose file. Caddy requests a Let’s Encrypt certificate on its own, as long as DNS points here and ports 80 and 443 are open.
Open the firewall and start the stack
serversudo ufw allow 80
sudo ufw allow 443
cd /opt/nextcloud
sudo docker compose up -d
sudo docker compose logs -f caddy
Press Ctrl+C to leave the logs once Caddy reports the certificate as obtained. The first start downloads the images and can take a few minutes. New to the firewall? UFW is the guide.
If it fails: Caddy logs a challenge error. DNS doesn’t point here yet, or port 80 is blocked in your provider’s network firewall. Fix that, then run sudo docker compose restart caddy.
Now open https:/, create the admin account, and set your time zone. Whoever reaches the setup page first becomes the admin, so do this right after the container starts.
Switch background jobs to cron
Nextcloud runs background work (cleanup, activity, notifications) through a background-job system. The default, AJAX, runs one job each time someone loads a page, which Nextcloud’s docs call the least reliable option; they recommend cron.
AJAX is the default, cron is what Nextcloud recommends. Source: docs.nextcloud.com, captured Nov 20, 2026.
Schedule cron.php on the host:
serversudo crontab -e
file*/5 * * * * docker exec -u www-data nextcloud-app php -f /var/www/html/cron.php
That runs the Nextcloud cron script inside the container every five minutes, as the www-data user the app uses. After the first run, Background jobs in the admin settings switches to Cron by itself. If it still shows a warning, check that the container name matches the one in the compose file (nextcloud-app).
Key takeaways
- To self host cloud storage, run Nextcloud for a Drive-style suite, Seafile for fast file sync, or Syncthing for device-to-device mirroring with no central server.
- Disk is the expensive part: a storage-heavy plan (HostHatch’s 1 TB on hard disks at $5.00/month) beats a general-purpose VPS for bulk files, but its 1 GB of RAM is tight for Nextcloud.
- The stack is Docker Compose plus Caddy: Nextcloud, MariaDB and a reverse proxy, with
NEXTCLOUD_TRUSTED_DOMAINSandOVERWRITEPROTOCOLset and the app port bound to 127.0.0.1. - Run
cron.phpfrom cron so the server does the background work instead of the next page load. - Back up the database and the data volume together under maintenance mode, copy them off the server, and test a restore — not just the backup.
A VPS for this guide
Everything above runs on a VPS with 2 GB of RAM or more. The cheapest 2 GB+ plan at each provider whose prices we read every day, IPv4 included:
| Plan · provider | vCPU · RAM · disk | You pay | Visit |
|---|---|---|---|
1 slice InterServer · New York +2 | 1 vCPU·2 GB·40 GB | $3.00/mo | |
KVM VPS Special 2 GB RackNerd · New York +3 | 2 vCPU·2 GB·35 GB | $3.00/mo | |
VPS nano G11.5s netcup · Nuremberg | 2 vCPU·2 GB·60 GB | $3.36/mo | |
SSD VPS 2 CloudCone · USA | 4 vCPU·2 GB·60 GB | $3.83/mo | |
NVMe 2 GB HostHatch · Amsterdam +15 | 1 vCPU·2 GB·10 GB | $4.00/mo |
Prices read Dec 4, 2026. gets that provider's deals on Telegram. Compare every 2 GB plan →
Back up Nextcloud, then test the restore
Nextcloud’s backup docs list what to keep: the config, data and theme folders (plus custom apps if you installed any) and the database. In this setup, all the folders sit in the nextcloud_data volume, so you need two pieces: a database dump and an archive of that volume, taken while the app is in maintenance mode so nothing writes mid-copy.
The official list; in the Docker setup the four folders all live in one volume. Source: docs.nextcloud.com, captured Nov 20, 2026.
Docker Compose prefixes volume names with the project folder, so the volume is nextcloud_nextcloud_data; sudo docker volume ls shows the exact name. The commands below stop writes, dump the database, archive the volume, then take the app back out of maintenance mode:
cd /opt/nextcloud
sudo mkdir -p /opt/nextcloud-backups
sudo docker exec -u www-data nextcloud-app php occ maintenance:mode --on
sudo docker exec nextcloud-db sh -c 'exec mariadb-dump --single-transaction -u root -p"$MYSQL_ROOT_PASSWORD" nextcloud' | sudo tee /opt/nextcloud-backups/nextcloud-db-$(date +%F).sql > /dev/null
sudo docker run --rm -v nextcloud_nextcloud_data:/data:ro -v /opt/nextcloud-backups:/backup ubuntu tar czf /backup/nextcloud-data-$(date +%F).tar.gz -C /data .
sudo docker exec -u www-data nextcloud-app php occ maintenance:mode --off
The dump command reads the root password from inside the database container, so it never lands in your shell history. Then pull the files off the server, from your own computer:
scp 'yourname@YOUR_SERVER_IP:/opt/nextcloud-backups/*' .
Keep the two passwords from .env with them. This is the same off-server habit as backing up a self-hosted password manager: a backup that lives on the same VPS disappears with the VPS.
Then test the restore, not just the backup. On a fresh server, bring up the same stack, turn maintenance mode on, load the SQL file into the empty database, extract the data archive into the nextcloud_data volume, turn maintenance mode off and confirm you can log in and see your files. A backup you have never restored is a hope, not a backup.
Honest trade-offs
Updates are on you. Nextcloud ships updates you have to apply yourself, and a major upgrade can need manual steps. If you let it sit, you are running known-vulnerable software on a box that holds your files.
Uptime is on you. A single VPS is a single point of failure. If it goes down, your files are down with it — which is fine for a personal cloud and not fine for anything people depend on.
You are the backup. There is no recycle bin in someone else’s data center when you self host. The off-server backup and restore test above are the whole safety net, and a provider can disappear with your data if the backup sits on the same account. When one small host announced it was closing this spring, a customer wrote:
Giving customers 2 weeks to migrate is a disgrace. Lessons learnt.
When a hosted service is the better call. If you want the apps and sharing without the maintenance, a hosted Nextcloud provider or a plain Google Drive / Dropbox is the safer default. Self-host because you want control or lower long-term cost, not because it is less work — it isn’t.
Private access. If you would rather not expose Nextcloud to the public internet at all, you can keep the domain internal and reach it over a VPN instead of a public reverse proxy — the same idea as OpenVPN vs WireGuard, where you trade a public URL for a client you install on each device.
Common Nextcloud self-hosting problems
“Access through untrusted domain.”The hostname you opened is not in NEXTCLOUD_TRUSTED_DOMAINS. The variable is read when Nextcloud is first installed; on a running server, add the name with sudo docker exec -u www-data nextcloud-app php occ config:system:set trusted_domains 1 --value=cloud.YOUR_DOMAIN.
Links or redirects point to http://.OVERWRITEPROTOCOL: https is missing from the app service. Add it and run sudo docker compose up -d to recreate the container.
Background jobs show a warning.The cron entry from step 7 is not running. Check sudo crontab -l and that the container name matches.
Big uploads fail through the web page.The official image limits PHP uploads to 512 MB by default. Add PHP_UPLOAD_LIMIT: 2G (or what you need) to the app’s environment and recreate the container. Caddy sets no body-size limit unless you add one with request_body.
A restored backup won’t start, or users are missing.The database and the data volume don’t match — usually the SQL file was taken at a different time from the data archive. Take both under maintenance mode, and restore them as a pair.
Disk is full.VPS disk fills up fast once photos and videos sync. Move the data volume to a bigger plan or attach block storage, and check what the clients are actually syncing.
Questions
How much does it cost to self host cloud storage?
The software is free; you pay for the server. Disk is the expensive part: a 1 TB storage VPS on hard disks costs $5.00/month in our data, while a comfortable Nextcloud box with SSD and 8 GB of RAM costs $15.17/month.
How much RAM does Nextcloud need?
Nextcloud’s docs ask for at least 128 MB per process and recommend 512 MB per process. For a VPS running Nextcloud plus MariaDB, we size at 2 GB so the database and background jobs have room.
Is self-hosted cloud storage safe?
Only as safe as your discipline: a current server, HTTPS, prompt updates, and off-server backups that you have tested with a restore. If any of those lapse, your files are safer on a hosted service.
Can I replace Google Drive with Nextcloud?
For most people, yes — file sync, a web interface, sharing links and phone apps cover the day-to-day, and Nextcloud Office can be added with a Collabora server. What you don’t get is someone else doing the updates and backups.
Nextcloud, Seafile or Syncthing — which should I choose?
Nextcloud for a Drive-like suite with apps; Seafile when fast, reliable file sync is the only thing you want; Syncthing when you want folders mirrored between your own devices with no central server and no sharing links.
Do I need a VPS for Nextcloud, or can I use a machine at home?
A home box works and keeps your data local. A VPS is the better call when you want it always-on, off-site, and reachable without opening ports on your home network — at the cost of paying for disk.
How we checked: The Nextcloud steps follow the official Docker image README on github.com/nextcloud/docker (the Compose example, NEXTCLOUD_TRUSTED_DOMAINS, OVERWRITEPROTOCOL, PHP_UPLOAD_LIMIT, running occ and cron.php as www-data) and the Nextcloud admin manual on docs.nextcloud.com (system requirements, background jobs, backup), all read on Nov 20, 2026; we did not run the commands on every provider’s image. RAM figures come from each project’s own documentation, not our measurement. Plan prices and the billing terms come from our daily reads of provider pages and our checked provider notes. How we check.