gitmyhub

docker

Shell ★ 7.3k updated 10d ago

A community maintained docker micro-image for deploying Nextcloud on container platforms

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.

ShellDockerPHPApachesetup: moderatecomplexity 3/5

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.

Where it fits