English
Get started

← All templates · Files and documents

Deploy Nextcloud in one click

File sync, calendar and contacts on a server of your own

A self-hosted alternative to Google Drive, Dropbox, and OneDrive.

What is Nextcloud?

Nextcloud is an open-source file sync and share platform, the one people run instead of Google Drive. Its desktop client keeps folders in sync on Windows, macOS and Linux, and the phone apps upload photos and videos as you take them. Calendars and address books sync with phones and Thunderbird over CalDAV and CardDAV. Hundreds of apps in its app store add more, such as Talk for chat and video calls.

People self-host Nextcloud to keep their files on a server they control, with no storage plan to outgrow and no fee per user. It fits a family as well as a small team, with groups, storage quotas and two-factor sign-in. The catch is email: Nextcloud has no mail server of its own, so password resets and share notifications need an SMTP service you set in its settings.

Hosting Nextcloud on Pethost

  1. You sign in to Pethost with a passkey, GitHub or Google. No machine yet? You pick a plan, and the link waits until it is ready.
  2. New project opens at Nextcloud. You fill in what it asks for and click Create project: Admin password.
  3. In a minute or two Nextcloud is live at its own address with HTTPS. Its secrets are made at random, and its data is in the nightly backup.
  4. It is a project like any other: you or your agent can change it, roll it back or restore it.

Questions about Nextcloud

Is Nextcloud free?

Yes. Nextcloud is open source under the AGPL-3.0 licence and free to run on your own server. Nextcloud GmbH sells Enterprise subscriptions to companies, which add support and longer maintenance of each release.

Can I share Nextcloud files with people who have no account?

Yes. A share link opens in any browser and can carry a password, an expiry date, or upload-only access as a file drop. Federated sharing also reaches people on other Nextcloud servers.

Can Nextcloud edit Word and Excel documents?

Yes, with Nextcloud Office, based on Collabora Online: several people edit DOCX, XLSX and PPTX files together in the browser. Its built-in CODE server app suits personal use and small teams; larger ones run a separate document server.

Can I import my Google Drive into Nextcloud?

Yes. The Google integration app imports files, calendars, contacts and chosen photos from a personal or Workspace account, after setup in the Google API Console. It is a one-time import that does not keep the two in sync.

Can I recover deleted files in Nextcloud?

Yes. Deleted files and folders go to a trash bin first, and the Versions tab keeps each file's history, so you can roll a file back to an earlier version.

How much memory and disk does Nextcloud need?

Nextcloud is moderate: under a gigabyte of memory, and your own files and their previews decide the disk. On Pethost the Grow plan is enough for it, with room for other apps beside it.

Nextcloud Docker Compose file

The template is this compose.yaml and the variables written into the project’s .env as it is created. Pethost runs the file as it is written.

Containers: app (nextcloud:34-apache), cron (nextcloud:34-apache), db (postgres:18-alpine), redis (redis:8-alpine).

Volumes, in the nightly backup: nextcloud, db, redis.

services:
  app:
    image: nextcloud:34-apache
    restart: unless-stopped
    depends_on:
      db:
        condition: service_healthy
      redis:
        condition: service_healthy
    environment: &nextcloud_env
      POSTGRES_HOST: db
      POSTGRES_DB: nextcloud
      POSTGRES_USER: nextcloud
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      REDIS_HOST: redis
      # The first start installs Nextcloud with this admin, so no setup page is left open.
      NEXTCLOUD_ADMIN_USER: admin
      NEXTCLOUD_ADMIN_PASSWORD: ${ADMIN_PASSWORD}
      NEXTCLOUD_TRUSTED_DOMAINS: ${HOST}
      OVERWRITEPROTOCOL: https
      OVERWRITEHOST: ${HOST}
      OVERWRITECLIURL: ${URL}
      # The machine's proxy reaches the container from this range.
      TRUSTED_PROXIES: 10.192.0.0/10
    volumes:
      - nextcloud:/var/www/html

  # Runs Nextcloud's background jobs every five minutes.
  cron:
    image: nextcloud:34-apache
    restart: unless-stopped
    entrypoint: /cron.sh
    depends_on:
      db:
        condition: service_healthy
      redis:
        condition: service_healthy
    environment: *nextcloud_env
    volumes:
      - nextcloud:/var/www/html

  db:
    image: postgres:18-alpine
    restart: unless-stopped
    environment:
      POSTGRES_DB: nextcloud
      POSTGRES_USER: nextcloud
      POSTGRES_PASSWORD: ${DB_PASSWORD}
    volumes:
      - db:/var/lib/postgresql
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -h 127.0.0.1 -U nextcloud -d nextcloud"]
      interval: 5s
      timeout: 5s
      retries: 12
      start_period: 30s

  redis:
    image: redis:8-alpine
    restart: unless-stopped
    volumes:
      - redis:/data
    healthcheck:
      test: ["CMD-SHELL", "redis-cli ping | grep -q PONG"]
      interval: 5s
      timeout: 3s
      retries: 12

volumes:
  nextcloud:
  db:
  redis:

More in Files and documents