Hands-on VPS & self-hosting Monday, June 1, 2026
VPS.app
Hands-on VPS benchmarks and self-hosting guides — tested, not theorized.
Self-Hosting Guides

How to Self-Host Nextcloud on a VPS (2026, Docker)

Some links below are affiliate links: if you buy through them I may earn a commission at no extra cost to you. I only recommend what I have actually tested, and it never changes my verdict.

Self-hosted cloud file storage

Nextcloud turns a cheap VPS into your own file cloud: file sync across devices, calendar, contacts, notes, and photo backup — without a monthly per-GB bill. This guide uses Docker Compose, which is the least painful way to run and update it.

Prerequisites

Step 1 — Create the Compose file

Create a folder and a docker-compose.yml:

services:
  db:
    image: mariadb:11
    restart: always
    command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW
    volumes:
      - db:/var/lib/mysql
    environment:
      MYSQL_ROOT_PASSWORD: change_me_root
      MYSQL_DATABASE: nextcloud
      MYSQL_USER: nextcloud
      MYSQL_PASSWORD: change_me

  app:
    image: nextcloud:stable
    restart: always
    ports:
      - "8080:80"
    depends_on:
      - db
    volumes:
      - nextcloud:/var/www/html
    environment:
      MYSQL_HOST: db
      MYSQL_DATABASE: nextcloud
      MYSQL_USER: nextcloud
      MYSQL_PASSWORD: change_me
      NEXTCLOUD_ADMIN_USER: admin
      NEXTCLOUD_ADMIN_PASSWORD: change_me_admin
      NEXTCLOUD_TRUSTED_DOMAINS: cloud.yourdomain.com

volumes:
  db:
  nextcloud:

Change every change_me* value and set NEXTCLOUD_TRUSTED_DOMAINS to your real subdomain.

Step 2 — Start it

docker compose up -d
docker compose logs -f app   # watch until it's ready

Nextcloud is now listening on port 8080 on the server (not public yet).

Step 3 — Add HTTPS with a reverse proxy

Don’t expose port 8080 directly. Put Nginx Proxy Manager in front, point cloud.yourdomain.comhttp://app:80 (or the host’s :8080), and let it issue a free Let’s Encrypt certificate. Full walkthrough: Nginx Proxy Manager setup.

Step 4 — First-run setup

Open https://cloud.yourdomain.com, log in with the admin user you set, and install the apps you want (Calendar, Contacts, Notes, Photos). For better performance with several users, add Redis for file locking — but the stack above is fine to start.

Which VPS to run it on

Nextcloud is light for one person but disk-hungry once you sync photos. A 2 GB managed instance on Cloudways is the hands-off option; a cheap Hetzner box is the best value if you’re comfortable on the CLI. Full comparison: Best VPS for Self-Hosting. For China access, see the BandwagonHost HK review.

Frequently asked questions

What VPS specs do I need for Nextcloud?

For personal use (a few users), 2 vCPU / 2 GB RAM and 40 GB+ disk is comfortable. Heavy use (photos, many users, on-the-fly previews) wants 4 GB+ and more disk.

Is self-hosting Nextcloud hard?

With Docker Compose it's about 20 minutes: paste a compose file, run one command, then point a domain and add HTTPS via a reverse proxy. No manual PHP/Apache tuning required.

How do I get HTTPS for Nextcloud?

Put a reverse proxy in front (Nginx Proxy Manager is the easiest) and let it issue a free Let's Encrypt certificate for your domain. See the linked reverse-proxy guide.

Nextcloud vs Google Drive — why self-host?

You own the data, there's no per-GB subscription (you pay only for the VPS), and you can add apps (calendar, contacts, notes, photo backup). The trade-off is you maintain it yourself.