Skip to content

Nextcloud

Nextcloud Docker install: All-in-One, Compose or managed hosting

Install Nextcloud with Docker using the official All-in-One image or a Docker Compose file, with the ports and domain each needs. Or skip the server with managed Nextcloud hosting on Zenith.

· $20 a month on Zenith · 50 GB for files · Sign in with Zenith

Deploy with Zenith

The short version

Host it on Zenith if

  • You want Nextcloud on a public HTTPS address without opening ports or pointing a domain.
  • You don't want to run Docker, a database and Redis, or keep them updated.
  • You want email, sign-in and an AI assistant already connected.

Run it yourself if

  • Your files already sit on a home server and you want Nextcloud on the same disks.
  • You want Nextcloud Office, Talk's high-performance backend or other All-in-One add-ons.
  • You want to decide exactly when Nextcloud upgrades.

The quickest way to install Nextcloud with Docker is Nextcloud All-in-One (AIO): one docker run command starts a mastercontainer that sets up Nextcloud, PostgreSQL, Redis and HTTPS for you. You need a Linux server, a domain pointed at it and port 443 open. If you'd rather not run a server, managed Nextcloud hosting on Zenith costs $20 a month.

What Nextcloud needs

Nextcloud is file sync and sharing, with calendar, contacts, mail and Deck boards as apps on top. It runs on PHP with a database such as MariaDB or PostgreSQL. Nextcloud recommends at least 512 MB of memory per PHP process.

There are two ways to run it in Docker:

  • Nextcloud All-in-One (AIO). Nextcloud's own installer. One "mastercontainer" sets up and updates Nextcloud, PostgreSQL, Redis and a web server, and can add Nextcloud Office, Talk, backups and more. It covers up to 100 users.
  • The community nextcloud image. A single container you wire up yourself with a database, a reverse proxy and cron. Nextcloud GmbH does not support it.

The next section uses All-in-One. A Docker Compose example for the community image follows it. For All-in-One you need a Linux server with Docker installed from Docker's own docs (snap installs are not supported), a domain pointed at the server, and port 443 open to the internet.

Install Nextcloud AIO with Docker

  1. 1

    Start the All-in-One mastercontainer

    Run this on the server. It is the command from the All-in-One README for a server with no other web server or reverse proxy on it.

    sudo docker run \ --init \ --sig-proxy=false \ --name nextcloud-aio-mastercontainer \ --restart always \ --publish 80:80 \ --publish 8080:8080 \ --publish 8443:8443 \ --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

    For a long-running server, the README recommends its example compose.yaml instead of docker run. Without the comments, it is this:

    name: nextcloud-aio services: nextcloud-aio-mastercontainer: image: ghcr.io/nextcloud-releases/all-in-one:latest init: true restart: always container_name: nextcloud-aio-mastercontainer volumes: - nextcloud_aio_mastercontainer:/mnt/docker-aio-config - /var/run/docker.sock:/var/run/docker.sock:ro network_mode: bridge ports: - "80:80" - "8080:8080" - "8443:8443" volumes: nextcloud_aio_mastercontainer: name: nextcloud_aio_mastercontainer

    Start it with docker compose up -d. Don't rename the container or the volume. All-in-One's own backup depends on those names.

  2. 2

    Open the setup interface

    Go to port 8080 on the server's IP address, for example https://192.168.5.5:8080, and accept the self-signed certificate. Use the IP address here, not your domain. Copy the passphrase it shows and use it to log in.

  3. 3

    Enter your domain

    Type the domain that points at your server. All-in-One checks that it can reach Nextcloud on that domain over port 443 before it continues. If you don't have a domain, All-in-One can register a dedyn.io subdomain.

  4. 4

    Pick add-ons and start

    Choose the optional containers you want, such as Nextcloud Office, Talk or the BorgBackup-based backup. Then start the containers. The first start downloads several images and takes a while.

  5. 5

    Sign in to Nextcloud

    When everything is running, the setup interface shows the initial admin username and password. Open your domain and sign in. Add Calendar, Contacts and other apps from the Apps page.

Nextcloud Docker Compose example

If you want to wire up the containers yourself, use the community nextcloud image with MariaDB. This is the basic example from the image's documentation, with the passwords filled in as placeholders. Replace both with long random values.

volumes: nextcloud: db: services: db: image: mariadb:10.6 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_PASSWORD=change-me-db - MYSQL_DATABASE=nextcloud - MYSQL_USER=nextcloud app: image: nextcloud restart: always ports: - 8080:80 links: - db volumes: - nextcloud:/var/www/html environment: - MYSQL_PASSWORD=change-me-db - MYSQL_DATABASE=nextcloud - MYSQL_USER=nextcloud - MYSQL_HOST=db

Run docker compose up -d and open http://localhost:8080 to create the admin account. This only listens on plain HTTP. Before you put it on the internet, add a reverse proxy with HTTPS, a Redis container for caching and a cron job for background tasks. The image's documentation has examples for each.

What you skip on Zenith

On your own serverOn Zenith
ServerRent a server or keep one running at home, and install DockerIncluded
Domain and HTTPSPoint a domain, open port 443, get a certificateYour own HTTPS address, or your domain
Database and cacheAll-in-One runs PostgreSQL and Redis on your serverMariaDB and Redis included
EmailSet up an SMTP provider for shares and password resetsIncluded
Sign-inAdmin username and passwordSign in with Zenith. You are the administrator
AISet up an AI provider and key for Nextcloud AssistantNextcloud Assistant connected to Zenith's AI
Updates and backupsRun them from the AIO interfaceUpdates included. Managed backups, best effort

Zenith does not include Nextcloud Office or Talk's high-performance backend. If you need those, All-in-One is the easier way to get them.

Managed Nextcloud hosting on Zenith

Zenith runs Nextcloud for you on its own instance, for $20 a month with 50 GB for files. Here is how to set it up.

  1. 1

    Click Deploy now on the Nextcloud page

    Open Nextcloud in the catalogue and click Deploy now. It costs $20 a month. If you don't have a Zenith account yet, you create one after paying.

  2. 2

    Choose an address

    Pick a name, then click Use this address. Your address becomes the name, a hyphen and your username, ending in .zh.run.

  3. 3

    Sign in with Zenith

    When Nextcloud is live, open it and choose Sign in with Zenith. Your Zenith account is the Nextcloud administrator. The admin password is also listed under Your credentials.

  4. 4

    Connect your devices

    Install the Nextcloud desktop or phone app, enter your Nextcloud address and sign in. Add the folders you want to sync, and the app uploads them for you.

Managed Nextcloud without the setup

$20 a month with 50 GB for files, email and Sign in with Zenith, on its own HTTPS address, with managed backups and updates.

Deploy with Zenith

Common questions

What is Nextcloud?
Nextcloud is software for file sync and sharing that you host yourself. Calendar, contacts, mail, Deck boards and other apps add to it, so a small team can keep files and schedules in one place.
How much does Nextcloud cost?
On Zenith it costs $20 a month with 50 GB for files. If you run it yourself, you pay for the server, and Nextcloud All-in-One covers up to 100 users, with more through Nextcloud Enterprise.
What is the official Nextcloud Docker image?
Nextcloud recommends Nextcloud All-in-One, ghcr.io/nextcloud-releases/all-in-one. There is also a community-maintained image called nextcloud on Docker Hub, which Nextcloud GmbH does not support.
Does Nextcloud All-in-One need a domain?
Yes. All-in-One does not support reaching Nextcloud by IP address or with a self-signed certificate. If you have no domain, it can register a dedyn.io subdomain for you.
Which ports does Nextcloud All-in-One use?
8080 for the setup interface, 80 for getting a certificate and 8443 for the setup interface with a valid certificate. Open 443/TCP for Nextcloud itself, and 3478 TCP and UDP if you use Talk.
Should I use Nextcloud AIO or the Docker Compose image?
All-in-One, unless you already run a reverse proxy and want to manage each container yourself. AIO sets up the database, Redis, HTTPS and updates for you. The community image gives you more control and more to maintain.
Is there managed Nextcloud hosting?
Yes. Zenith runs Nextcloud with its database, Redis, email and an HTTPS address for $20 a month, with 50 GB for files. Sign in with your Zenith account. You are the administrator.
Can I connect the Nextcloud desktop and phone apps?
Yes. Enter your Nextcloud address in the app and sign in. On Zenith that is your .zh.run address, or your own domain.