explaingit

nextcloud/docker

7,259ShellAudience · ops devopsComplexity · 3/5Setup · moderate

TLDR

The official Docker image for Nextcloud, letting you self-host a private file storage and sharing server in a container with support for MySQL, PostgreSQL, ARM devices, and auto-configuration via environment variables.

Mindmap

mindmap
  root((Nextcloud Docker))
    What it does
      Self-hosted file storage
      Sharing and sync
      Containerized deployment
    Image variants
      Apache all-in-one
      FPM slim option
      Multi-arch ARM support
    Database options
      SQLite for personal use
      MySQL and MariaDB
      PostgreSQL
    Configuration
      Env var auto-setup
      Persistent volumes
      Docker Compose wiring
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Run a private Nextcloud file server in Docker without manually installing PHP, Apache, or their dependencies.

USE CASE 2

Wire up Nextcloud with a MariaDB container and a reverse proxy using Docker Compose for a production-ready self-hosted setup.

USE CASE 3

Deploy Nextcloud on a Raspberry Pi or other ARM device using one of the multi-architecture image variants.

Tech stack

ShellDockerPHPApache

Getting it running

Difficulty · moderate Time to first run · 30min

Requires Docker and Docker Compose, a separate database container and named volumes are needed for a reliable production setup.

In plain English

This repository provides the official Docker container image for Nextcloud, a self-hosted file storage and sharing platform. Nextcloud lets you store files, calendars, contacts, and email on your own server rather than a third-party cloud service, and access them from any device. The Docker image here packages Nextcloud so you can run it in a container environment without manually installing all its dependencies. There are two main variants of the image. The apache variant bundles a web server and is ready to use with a single command, exposing the application on port 80. The fpm variant is a slimmer option that runs only the PHP process and requires you to pair it with a separate web server container to handle incoming requests. Most people starting out will use the apache variant. By default, the container uses SQLite for its database, which works for small personal setups. For anything more serious, the README covers how to connect it to MySQL, MariaDB, or PostgreSQL, either by linking a database container or providing connection details through environment variables. Auto-configuration via environment variables also lets you skip the web-based setup wizard entirely on first run, supplying the admin username, password, and database settings upfront. Persistent data, meaning your uploaded files and configuration, lives in a Docker volume at /var/www/html. The README explains how to mount named volumes or host directories for each major folder, including the data directory, configuration, custom apps, and themes. This matters for upgrades and backups: if you do not mount a volume, your data is still preserved between container restarts, but managing upgrades becomes harder. The image supports multiple processor architectures, including standard 64-bit, several ARM variants for devices like Raspberry Pi, and others. A Docker Compose section in the README shows how to wire up Nextcloud together with a database container and optionally a reverse proxy, which is the recommended approach for anything beyond quick local testing.

Copy-paste prompts

Prompt 1
Write a Docker Compose file that runs Nextcloud with a MariaDB database, named volumes for persistent file storage, and sets the admin username and password via environment variables so the setup wizard is skipped.
Prompt 2
How do I upgrade my Nextcloud Docker container to the next major version without losing my uploaded files or configuration?
Prompt 3
How do I add an Nginx reverse proxy container in front of Nextcloud in Docker Compose so I can serve it over HTTPS with a Let's Encrypt certificate?
Open on GitHub → Explain another repo

← nextcloud on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.