Save Money on Subscriptions with a Self-Hosted Cloud VPS
Replace parts of Google Drive, Dropbox, iCloud, Microsoft 365, and other subscriptions by running Nextcloud securely on a GoZen VPS.
12 min read
Cloud subscriptions are convenient until they pile up. A little storage here, a notes app there, a family photo plan, a document editor, maybe a password or task app too. None of them looks expensive alone. Together, they turn into a monthly bill that never really stops.
A VPS gives you another option: pay for one server, run the tools you actually use, and keep the data under your own domain.
This guide builds that idea around Nextcloud because it can replace a real bundle of everyday tools:
- File sync and sharing
- Calendar and contacts
- Notes
- Photos and automatic phone uploads
- Browser-based document editing
- Basic tasks and project lists
- Optional apps like bookmarks, forms, passwords, collectives, and full-text search
If you only want a quick Nextcloud install, start with Hosting Nextcloud on GoZen. This guide is for replacing several paid tools with one maintained VPS setup.
This is not a magic way to get free software with no responsibility. You become the person responsible for updates, backups, and account security. The goal is to make that responsibility clear and manageable.
What This Replaces
Nextcloud can replace parts of several subscriptions, depending on how you use them today.
| Paid tool category | What Nextcloud can cover | What to keep in mind |
|---|---|---|
| Cloud storage | Files, folders, sharing links, desktop sync, mobile upload | Your VPS storage size becomes the limit |
| Google Photos / iCloud Photos style backup | Mobile auto-upload through the Nextcloud app | Photo search and AI features are not the same as Big Tech services |
| Google Docs / Microsoft Office basics | Nextcloud Office through the AIO stack | Fine for normal documents, not a full Microsoft 365 replacement for every business workflow |
| Calendar and contacts | CalDAV and CardDAV sync | Works well, but each device must be configured |
| Notes and simple knowledge base | Nextcloud Notes, Collectives, or Markdown files | Pick one notes workflow and stick to it |
| Dropbox-style file sharing | Password-protected and expiring share links | External sharing still needs good user habits |
Do not move everything on day one. Start with files, calendar, contacts, and phone photo uploads. Once that feels boring and reliable, add more.
When This Is Worth It
Self-hosting makes sense when:
- You already pay for multiple storage or productivity subscriptions
- You want one private place for family, team, or client files
- You are comfortable owning backups and updates
- You want a domain like
cloud.example.cominstead of another vendor account - You prefer predictable VPS pricing over several separate subscriptions
It is probably not worth it if you only need 50 GB of storage, never want to touch a server, or need enterprise compliance features from a managed SaaS provider.
Recommended VPS Size
Use Ubuntu 24.04 LTS for this guide.
| Use case | Minimum VPS | Notes |
|---|---|---|
| Personal cloud, 1-2 users | 2 vCPU, 4 GB RAM, 80 GB storage | Files, calendar, contacts, notes |
| Family cloud, 2-5 users | 4 vCPU, 8 GB RAM, 150 GB+ storage | Better for photo upload and office documents |
| Small team | 4-8 vCPU, 8-16 GB RAM, 250 GB+ storage | Add monitoring and stricter backup routine |
Storage matters more than CPU for most people. If you plan to store photos and videos, choose a VPS with room to grow.
What We Are Building
We will install:
- Docker from Docker’s official Ubuntu repository
- Caddy as the public HTTPS reverse proxy
- Nextcloud All-in-One, usually called Nextcloud AIO
- Nextcloud data stored at
/srv/nextcloud-data - AIO’s admin interface bound to
127.0.0.1, reachable only through an SSH tunnel
Why this setup?
- Caddy handles HTTPS certificates automatically.
- Nextcloud AIO manages PostgreSQL, Redis, Nextcloud Office, optional ClamAV, backups, and updates from one interface.
- The public internet only sees ports
80and443. - The AIO admin panel is not exposed publicly.
Before You Start
You need:
- A GoZen VPS running Ubuntu 24.04 LTS
- A domain or subdomain, for example
cloud.example.com - DNS
Arecord pointing that name to your VPS IP address - SSH access to the VPS
- A local terminal on your computer
Replace this value before you paste commands:
export NC_DOMAIN="cloud.example.com"
To confirm DNS points to your VPS:
getent ahostsv4 "$NC_DOMAIN" | awk '{print $1; exit}'
The IP printed here should match the VPS public IPv4 address shown in the GoZen client area. If it does not, fix DNS first and wait for propagation.
Step 1: Update the Server
SSH into the VPS as root or as a sudo user.
sudo apt update
sudo apt upgrade -y
sudo reboot
Reconnect after the reboot:
ssh root@your-server-ip
If you created a non-root sudo user during first boot, use that user instead.
Set the variable again after reconnecting:
export NC_DOMAIN="cloud.example.com"
Step 2: Set Basic Firewall Rules
Allow SSH, HTTP, and HTTPS. Nothing else should be public for this setup.
sudo apt install ufw -y
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow OpenSSH
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw --force enable
sudo ufw status verbose
You should see SSH, 80/tcp, and 443/tcp allowed.
Docker can publish ports in ways that bypass normal UFW expectations. In this guide, the AIO admin interface is bound to 127.0.0.1 and the Nextcloud backend is also bound to 127.0.0.1, so only Caddy should be reachable from the internet.
Step 3: Install Docker from the Official Repository
Remove conflicting packages first. This command is safe if none of them exist.
for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do
sudo apt remove -y "$pkg" 2>/dev/null || true
done
Install Docker using Docker’s apt repository:
sudo apt update
sudo apt install -y ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
sudo tee /etc/apt/sources.list.d/docker.sources >/dev/null <<EOF
Types: deb
URIs: https://download.docker.com/linux/ubuntu
Suites: $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}")
Components: stable
Architectures: $(dpkg --print-architecture)
Signed-By: /etc/apt/keyrings/docker.asc
EOF
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo systemctl enable --now docker
sudo docker run --rm hello-world
If hello-world prints a success message, Docker is working.
Step 4: Install Caddy
Caddy will sit in front of Nextcloud and handle HTTPS.
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo chmod o+r /usr/share/keyrings/caddy-stable-archive-keyring.gpg
sudo chmod o+r /etc/apt/sources.list.d/caddy-stable.list
sudo apt update
sudo apt install -y caddy
sudo systemctl enable --now caddy
Check it:
systemctl status caddy --no-pager
Step 5: Configure Caddy for Nextcloud
Create a Caddyfile that sends your cloud domain to the internal Nextcloud AIO Apache port.
sudo cp /etc/caddy/Caddyfile /etc/caddy/Caddyfile.backup.$(date +%Y%m%d-%H%M%S)
sudo tee /etc/caddy/Caddyfile >/dev/null <<EOF
$NC_DOMAIN {
reverse_proxy 127.0.0.1:11000
}
EOF
Validate and reload Caddy:
sudo caddy validate --config /etc/caddy/Caddyfile
sudo systemctl reload caddy
At this point Caddy may show a temporary 502 for your domain. That is fine. Nextcloud is not running yet.
Step 6: Create the Nextcloud Data Directory
This is where user files will live.
sudo mkdir -p /srv/nextcloud-data
sudo chown -R 33:0 /srv/nextcloud-data
sudo chmod 750 /srv/nextcloud-data
Do not put the data directory inside a web root such as /var/www.
Step 7: Start Nextcloud AIO
This starts the AIO master container. It will manage the rest of the Nextcloud stack.
sudo docker run \
--init \
--sig-proxy=false \
--name nextcloud-aio-mastercontainer \
--restart always \
--publish 127.0.0.1:8080:8080 \
--env APACHE_PORT=11000 \
--env APACHE_IP_BINDING=127.0.0.1 \
--env APACHE_ADDITIONAL_NETWORK="" \
--env SKIP_DOMAIN_VALIDATION=false \
--env NEXTCLOUD_DATADIR="/srv/nextcloud-data" \
--volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \
--volume /var/run/docker.sock:/var/run/docker.sock:ro \
ghcr.io/nextcloud-releases/all-in-one:latest
Check that it is running:
sudo docker ps --filter name=nextcloud-aio-mastercontainer
The AIO admin interface is now listening on the VPS itself at 127.0.0.1:8080. It is not public.
Step 8: Open the AIO Admin Interface Through an SSH Tunnel
Run this on your local computer, not inside the VPS:
ssh -L 8080:127.0.0.1:8080 root@your-server-ip
If you use a non-root sudo user:
ssh -L 8080:127.0.0.1:8080 your-user@your-server-ip
Keep that SSH session open. Then open this URL on your computer:
https://127.0.0.1:8080
Your browser will warn about a self-signed certificate. That is expected for the local AIO admin interface.
Copy the initial AIO passphrase and store it in your password manager.
Step 9: Finish the Nextcloud AIO Setup
In the AIO interface:
- Enter your domain, for example
cloud.example.com - Let AIO check the domain
- Choose the containers you want
- Start the containers
Recommended first set:
| Component | Recommendation | Why |
|---|---|---|
| Nextcloud | Required | Main application |
| PostgreSQL | Required | Database |
| Redis | Required | Cache and file locking |
| Nextcloud Office | Enable | Replaces basic document editing subscriptions |
| ClamAV | Optional | Useful for shared family or team storage, but uses RAM |
| Full-text search | Optional | Useful later, heavier on resources |
| Talk | Optional | Do not enable on a small VPS unless you really need it |
When AIO finishes, open:
https://cloud.example.com
Use your real domain, not the example.
Step 10: Create Users and Turn On Two-Factor Authentication
Create a separate user for each person. Do not share one account across a family or team.
In Nextcloud:
- Open the account menu (top right) > Accounts
- Create an account for each person
- Open Administration settings > Security
- Enforce two-factor authentication
Install the Two-Factor TOTP Provider app if it is not already available.
For each user:
- Use a unique password
- Enable TOTP with an authenticator app
- Save backup codes
- Avoid making everyone an admin
Step 11: Install the Apps That Replace Your Subscriptions
Start small.
| Need | Nextcloud app or feature |
|---|---|
| File sync | Files, desktop sync client, mobile app |
| Phone photo backup | Nextcloud mobile app auto-upload |
| Calendar | Calendar |
| Contacts | Contacts |
| Notes | Notes |
| Documents | Nextcloud Office |
| Tasks | Tasks |
| Team wiki | Collectives |
| Bookmarks | Bookmarks |
| Forms | Forms |
Do not install twenty apps on the first day. Add what you actually use, then check performance.
Step 12: Set Up Backups Before You Trust It
Do this before you move important files.
In the AIO interface:
- Open Backup and restore
- Choose a backup location
- Set a daily schedule
- Save the backup password in your password manager
- Run a manual backup
Good backup locations:
- A second disk mounted on the VPS
- A storage box or SFTP target
- Another server
- Object storage, if you add it through a supported workflow
Bad backup locations:
- Only inside the same Nextcloud data directory
- Only on your laptop
- Only in one copy on the same VPS
After the first backup, verify that backup files exist:
sudo find / -maxdepth 4 -type d -iname "*backup*" 2>/dev/null | head
That command is only a helper. The real source of truth is the AIO backup screen.
Step 13: Test a Restore Before You Depend on It
A backup you have never restored hasn’t been tested. An AIO restore rolls the whole instance back to the backup time, so do this test before you move real data in, using throwaway data:
- Upload a test folder to Nextcloud
- Run a manual backup in AIO
- Delete the test folder
- Restore from the backup (this restores the entire instance, not just the folder)
- Confirm the folder comes back
Step 14: Connect Your Devices
Install the official Nextcloud clients:
- Desktop sync client for your laptop or workstation
- Mobile app for photo upload
- Calendar and contacts sync using CalDAV and CardDAV
Suggested first sync:
- One small folder from your computer
- Phone camera uploads
- Calendar
- Contacts
Wait a few days before moving your entire archive. Watch disk usage and sync behavior first.
Step 15: Monthly Maintenance Routine
Put this on your calendar.
Every Week
sudo apt update
apt list --upgradable
sudo docker ps
df -h
sudo du -sh /srv/nextcloud-data
Check the AIO interface for:
- Container health
- Available updates
- Last backup status
- Security warnings in Nextcloud
Every Month
sudo apt upgrade -y
sudo reboot
Then reconnect and check:
sudo docker ps
systemctl status caddy --no-pager
In the AIO interface:
- Run a backup
- Apply AIO updates
- Apply Nextcloud app updates
- Confirm the site works
- Check the Nextcloud admin overview page
Do updates when you have time to fix something, not five minutes before a trip.
Step 16: Watch Disk Usage
Check how much space user files, Docker images, and build cache take up:
df -h
sudo du -sh /srv/nextcloud-data
sudo docker system df
If Docker images and build cache grow too much:
sudo docker system prune
Do not run docker system prune -a casually. It removes unused images more aggressively. It should not delete volumes, but it can make rollbacks slower and cause large re-downloads.
Step 17: What Not to Self-Host Yet
Some subscriptions are easy to replace. Some are not.
Be careful with:
- Primary business email
- Password managers, unless you already understand backup and recovery
- Accounting and tax software
- Anything with legal retention requirements
- Anything your team cannot afford to lose for a day
Nextcloud is a good first serious self-hosted service because it teaches the right habits: DNS, HTTPS, backups, updates, storage planning, and user access.
Troubleshooting
| Problem | Check |
|---|---|
| Caddy shows 502 | AIO containers may not be started yet. Check the AIO interface and sudo docker ps |
| Domain validation fails | Confirm DNS points to this VPS and ports 80/443 are open |
| Cannot open AIO interface | Make sure the SSH tunnel is running and open https://127.0.0.1:8080 locally |
| Uploads fail or stop | Check VPS disk space and AIO container health |
| Office documents are slow | Add CPU/RAM or disable heavier optional containers |
| Phone uploads stop | Check mobile app battery permissions and background sync settings |
| Backups fail | Check free disk space, backup destination permissions, and the AIO backup screen |
Useful commands:
sudo docker ps
sudo docker logs nextcloud-aio-mastercontainer --tail=100
systemctl status caddy --no-pager
journalctl -u caddy -n 100 --no-pager
df -h
When to Upgrade the VPS
Upgrade when you see one of these patterns:
- Disk usage is above 80 percent after cleanup
- Office documents feel slow for multiple users
- Photo previews take too long to generate
- Backups take so long they overlap with busy hours
- The VPS swaps under normal use
Storage upgrades are the most common. RAM comes next. CPU matters most when you use Office, previews, full-text search, or Talk.
What Comes Next
Once this setup is stable, the natural next step is a second tutorial: adding a private dashboard and a few lightweight tools beside Nextcloud, all behind the same Caddy reverse proxy.
Good candidates:
- Uptime Kuma for monitoring
- Vaultwarden for password management
- Mealie for recipes and meal planning
- Linkding for bookmarks
- Actual Budget for personal finance
Do that only after your Nextcloud backups and updates feel routine.
Related Articles
- First Boot: Initial Server Setup
- Docker Basics for VPS Users
- Hosting Nextcloud on GoZen
- VPS Security Checklist
- Monitoring Your Server
- How to Manage Disk Space on a VPS
Sources
Last updated 21 Oct 2026, 00:00 +0300.