# nextcloud/docker architecture

> Architecture diagram of the GitHub repository nextcloud/docker, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nextcloud/docker
- Repository: https://github.com/nextcloud/docker

## Overview

This tree is a small slice of the Nextcloud Docker image repository: versioned PHP configuration fragments for Apache, FPM, and Alpine FPM images. The documented deployment flow is to run an image, route HTTP traffic directly to Apache or through an external web server to FPM, and use environment-driven configuration for Nextcloud. The sampled source confirms app search paths; other configuration capabilities are evident from filenames and README headings, but their implementations and wiring are not shown here.

Main entry points: [`35/apache/config`](https://github.com/nextcloud/docker/tree/master/35/apache/config) (Apache image), [`35/fpm/config`](https://github.com/nextcloud/docker/tree/master/35/fpm/config) (FPM image), [`35/fpm-alpine/config`](https://github.com/nextcloud/docker/tree/master/35/fpm-alpine/config) (Alpine FPM image), [`35/apache/config/autoconfig.php`](https://github.com/nextcloud/docker/blob/master/35/apache/config/autoconfig.php) (Auto configuration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_images["Image variants"]
  node_apache["Apache image"]
  node_fpm["FPM image"]
  node_fpm_alpine["Alpine FPM image"]
end

subgraph group_runtime["Runtime configuration"]
  node_autoconfig["Auto configuration<br/>[autoconfig.php]"]
  node_app_paths["App paths<br/>[apps.config.php]"]
  node_proxy_config["Proxy settings"]
  node_apache_urls["Apache URLs"]
  node_upgrade_config["Upgrade control"]
end

subgraph group_integrations["Optional integrations"]
  node_apcu_config["APCu cache<br/>[apcu.config.php]"]
  node_redis_config["Redis cache<br/>[redis.config.php]"]
  node_s3_config["S3 storage<br/>[s3.config.php]"]
  node_smtp_config["SMTP mail<br/>[smtp.config.php]"]
  node_swift_config["Swift storage<br/>[swift.config.php]"]
end

node_operator(("Deployment operator"))
node_webserver["External web server"]
node_nextcloud["Nextcloud application"]

node_operator -->|"runs"| node_apache
node_operator -->|"runs"| node_fpm
node_operator -->|"runs"| node_fpm_alpine
node_webserver -->|"proxies requests"| node_fpm
node_apache -->|"serves HTTP"| node_nextcloud
node_fpm -->|"executes FastCGI"| node_nextcloud
node_fpm_alpine -->|"executes FastCGI"| node_nextcloud
node_autoconfig -->|"configures"| node_nextcloud
node_app_paths -->|"sets app paths"| node_nextcloud
node_proxy_config -->|"configures proxy"| node_nextcloud
node_apache_urls -->|"configures URLs"| node_apache
node_upgrade_config -->|"controls upgrades"| node_nextcloud
node_apcu_config -.->|"configures cache"| node_nextcloud
node_redis_config -.->|"configures cache"| node_nextcloud
node_s3_config -.->|"configures storage"| node_nextcloud
node_smtp_config -.->|"configures mail"| node_nextcloud
node_swift_config -.->|"configures storage"| node_nextcloud

click node_apache "https://github.com/nextcloud/docker/tree/master/35/apache/config"
click node_fpm "https://github.com/nextcloud/docker/tree/master/35/fpm/config"
click node_fpm_alpine "https://github.com/nextcloud/docker/tree/master/35/fpm-alpine/config"
click node_autoconfig "https://github.com/nextcloud/docker/blob/master/35/apache/config/autoconfig.php"
click node_app_paths "https://github.com/nextcloud/docker/blob/master/35/apache/config/apps.config.php"
click node_proxy_config "https://github.com/nextcloud/docker/blob/master/35/apache/config/reverse-proxy.config.php"
click node_apache_urls "https://github.com/nextcloud/docker/blob/master/35/apache/config/apache-pretty-urls.config.php"
click node_upgrade_config "https://github.com/nextcloud/docker/blob/master/35/apache/config/upgrade-disable-web.config.php"
click node_apcu_config "https://github.com/nextcloud/docker/blob/master/35/apache/config/apcu.config.php"
click node_redis_config "https://github.com/nextcloud/docker/blob/master/35/apache/config/redis.config.php"
click node_s3_config "https://github.com/nextcloud/docker/blob/master/35/apache/config/s3.config.php"
click node_smtp_config "https://github.com/nextcloud/docker/blob/master/35/apache/config/smtp.config.php"
click node_swift_config "https://github.com/nextcloud/docker/blob/master/35/apache/config/swift.config.php"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_apache,node_fpm,node_fpm_alpine toneBlue
class node_autoconfig,node_app_paths,node_proxy_config,node_apache_urls,node_upgrade_config toneAmber
class node_apcu_config,node_redis_config,node_s3_config,node_smtp_config,node_swift_config,node_webserver toneMint
class node_operator,node_nextcloud toneIndigo
```

## Components

### Image variants

- [Apache image](https://github.com/nextcloud/docker/tree/master/35/apache/config): `35/apache/config`
- [FPM image](https://github.com/nextcloud/docker/tree/master/35/fpm/config): `35/fpm/config`
- [Alpine FPM image](https://github.com/nextcloud/docker/tree/master/35/fpm-alpine/config): `35/fpm-alpine/config`

### Runtime configuration

- [Auto configuration](https://github.com/nextcloud/docker/blob/master/35/apache/config/autoconfig.php): `35/apache/config/autoconfig.php`
- [App paths](https://github.com/nextcloud/docker/blob/master/35/apache/config/apps.config.php): `35/apache/config/apps.config.php`
- [Proxy settings](https://github.com/nextcloud/docker/blob/master/35/apache/config/reverse-proxy.config.php): `35/apache/config/reverse-proxy.config.php`
- [Apache URLs](https://github.com/nextcloud/docker/blob/master/35/apache/config/apache-pretty-urls.config.php): `35/apache/config/apache-pretty-urls.config.php`
- [Upgrade control](https://github.com/nextcloud/docker/blob/master/35/apache/config/upgrade-disable-web.config.php): `35/apache/config/upgrade-disable-web.config.php`

### Optional integrations

- [APCu cache](https://github.com/nextcloud/docker/blob/master/35/apache/config/apcu.config.php): `35/apache/config/apcu.config.php`
- [Redis cache](https://github.com/nextcloud/docker/blob/master/35/apache/config/redis.config.php): `35/apache/config/redis.config.php`
- [S3 storage](https://github.com/nextcloud/docker/blob/master/35/apache/config/s3.config.php): `35/apache/config/s3.config.php`
- [SMTP mail](https://github.com/nextcloud/docker/blob/master/35/apache/config/smtp.config.php): `35/apache/config/smtp.config.php`
- [Swift storage](https://github.com/nextcloud/docker/blob/master/35/apache/config/swift.config.php): `35/apache/config/swift.config.php`

### Other components

- **Deployment operator**
- **External web server**
- **Nextcloud application**

## Connections

- Deployment operator → Apache image: runs
- Deployment operator → FPM image: runs
- Deployment operator → Alpine FPM image: runs
- External web server → FPM image: proxies requests
- Apache image → Nextcloud application: serves HTTP
- FPM image → Nextcloud application: executes FastCGI
- Alpine FPM image → Nextcloud application: executes FastCGI
- Auto configuration → Nextcloud application: configures
- App paths → Nextcloud application: sets app paths
- Proxy settings → Nextcloud application: configures proxy
- Apache URLs → Apache image: configures URLs
- Upgrade control → Nextcloud application: controls upgrades
- APCu cache → Nextcloud application: configures cache
- Redis cache → Nextcloud application: configures cache
- S3 storage → Nextcloud application: configures storage
- SMTP mail → Nextcloud application: configures mail
- Swift storage → Nextcloud application: configures storage
