{"id":13443034,"url":"https://github.com/crazy-max/docker-nextcloud","last_synced_at":"2026-04-02T16:36:14.209Z","repository":{"id":27360701,"uuid":"105207962","full_name":"crazy-max/docker-nextcloud","owner":"crazy-max","description":"Nextcloud Docker image","archived":false,"fork":false,"pushed_at":"2025-03-22T11:18:13.000Z","size":750,"stargazers_count":256,"open_issues_count":3,"forks_count":46,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-03T13:18:36.002Z","etag":null,"topics":["alpine-linux","cron","docker","docker-compose","letsencrypt","mariadb","nextcloud","nginx","redis","ssmtp","traefik"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/crazy-max.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":".github/SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"crazy-max","custom":"https://www.paypal.me/crazyws"}},"created_at":"2017-09-28T23:14:54.000Z","updated_at":"2025-03-31T00:15:15.000Z","dependencies_parsed_at":"2024-11-29T10:28:14.420Z","dependency_job_id":"b2e3b2e9-a9f1-4c39-9acf-ced11d1d957f","html_url":"https://github.com/crazy-max/docker-nextcloud","commit_stats":{"total_commits":470,"total_committers":7,"mean_commits":67.14285714285714,"dds":"0.12127659574468086","last_synced_commit":"3f76f996592f47439ff754b96c53051366d70770"},"previous_names":[],"tags_count":362,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crazy-max%2Fdocker-nextcloud","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crazy-max%2Fdocker-nextcloud/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crazy-max%2Fdocker-nextcloud/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crazy-max%2Fdocker-nextcloud/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crazy-max","download_url":"https://codeload.github.com/crazy-max/docker-nextcloud/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248578876,"owners_count":21127716,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alpine-linux","cron","docker","docker-compose","letsencrypt","mariadb","nextcloud","nginx","redis","ssmtp","traefik"],"created_at":"2024-07-31T03:01:55.118Z","updated_at":"2026-04-02T16:36:14.198Z","avatar_url":"https://github.com/crazy-max.png","language":"Dockerfile","readme":"\u003cp align=\"center\"\u003e\u003ca href=\"https://github.com/crazy-max/docker-nextcloud\" target=\"_blank\"\u003e\u003cimg height=\"128\" src=\"https://raw.githubusercontent.com/crazy-max/docker-nextcloud/master/.github/docker-nextcloud.jpg\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://hub.docker.com/r/crazymax/nextcloud/tags?page=1\u0026ordering=last_updated\"\u003e\u003cimg src=\"https://img.shields.io/github/v/tag/crazy-max/docker-nextcloud?label=version\u0026style=flat-square\" alt=\"Latest Version\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/crazy-max/docker-nextcloud/actions?workflow=build\"\u003e\u003cimg src=\"https://img.shields.io/github/actions/workflow/status/crazy-max/docker-nextcloud/build.yml?branch=master\u0026label=build\u0026logo=github\u0026style=flat-square\" alt=\"Build Status\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://hub.docker.com/r/crazymax/nextcloud/\"\u003e\u003cimg src=\"https://img.shields.io/docker/stars/crazymax/nextcloud.svg?style=flat-square\u0026logo=docker\" alt=\"Docker Stars\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://hub.docker.com/r/crazymax/nextcloud/\"\u003e\u003cimg src=\"https://img.shields.io/docker/pulls/crazymax/nextcloud.svg?style=flat-square\u0026logo=docker\" alt=\"Docker Pulls\"\u003e\u003c/a\u003e\n  \u003cbr /\u003e\u003ca href=\"https://github.com/sponsors/crazy-max\"\u003e\u003cimg src=\"https://img.shields.io/badge/sponsor-crazy--max-181717.svg?logo=github\u0026style=flat-square\" alt=\"Become a sponsor\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.paypal.me/crazyws\"\u003e\u003cimg src=\"https://img.shields.io/badge/donate-paypal-00457c.svg?logo=paypal\u0026style=flat-square\" alt=\"Donate Paypal\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## About\n\n[Nextcloud](https://nextcloud.com) Docker image with advanced features.\n\n\u003e [!TIP] \n\u003e Want to be notified of new releases? Check out 🔔 [Diun (Docker Image Update Notifier)](https://github.com/crazy-max/diun)\n\u003e project!\n\n___\n\n* [Features](#features)\n* [Build locally](#build-locally)\n* [Image](#image)\n* [Environment variables](#environment-variables)\n  * [General](#general)\n  * [Nextcloud](#nextcloud)\n  * [Cron](#cron)\n  * [Previews generator](#previews-generator)\n  * [News Updater](#news-updater)\n* [Volumes](#volumes)\n* [Ports](#ports)\n* [Usage](#usage)\n  * [Docker Compose](#docker-compose)\n  * [Command line](#command-line)\n* [Upgrade](#upgrade)\n* [Notes](#notes)\n  * [First installation](#first-installation)\n  * [OCC command](#occ-command)\n  * [Cron sidecar](#cron-sidecar)\n  * [Previews generator sidecar](#previews-generator-sidecar)\n  * [Nextcloud News Updater](#nextcloud-news-updater)\n  * [Email server](#email-server)\n  * [Redis cache](#redis-cache)\n  * [Running in a subdir](#running-in-a-subdir)\n* [Contributing](#contributing)\n* [License](#license)\n\n## Features\n\n* Run as non-root user\n* Multi-platform image\n* Tarball authenticity checked during building process\n* Data, config, user apps and themes persistence in the same folder\n* [Automatic installation](https://docs.nextcloud.com/server/stable/admin_manual/configuration_server/automatic_configuration.html)\n* Cron task for [Nextcloud background jobs](https://docs.nextcloud.com/server/stable/admin_manual/configuration_server/background_jobs_configuration.html#cron) as a [sidecar cron container](#cron-sidecar)\n* Execute pre-generation of previews through [Preview Generator](https://github.com/rullzer/previewgenerator) plugin\n* Handle [Nextcloud News Updater](https://github.com/nextcloud/news-updater) for [News plugin](https://apps.nextcloud.com/apps/news) through a [sidecar news updater container](#nextcloud-news-updater)\n* OPCache enabled to store precompiled script bytecode in shared memory\n* APCu installed and configured\n* Memcached and Redis also enabled to enhance server performance\n* Database connectors MySQL/MariaDB, PostgreSQL and SQLite3 enabled\n* Exif, IMAP, LDAP, FTP, GMP, SMB enabled (required for specific apps)\n* FFmpeg, iconv, Imagick installed for preview generation\n* [s6-overlay](https://github.com/just-containers/s6-overlay/) as process supervisor\n* [Traefik](https://github.com/containous/traefik-library-image) as reverse proxy and creation/renewal of Let's Encrypt certificates (see [this template](examples/traefik))\n* [msmtpd SMTP relay](https://github.com/crazy-max/docker-msmtpd) image to send emails\n* [Redis](https://github.com/docker-library/redis) for caching\n* [MariaDB](https://github.com/docker-library/mariadb) as database instance\n\n## Build locally\n\n```shell\ngit clone https://github.com/crazy-max/docker-nextcloud.git\ncd docker-nextcloud\n\n# Build image and output to docker (default)\ndocker buildx bake\n\n# Build multi-platform image\ndocker buildx bake image-all\n```\n\n## Image\n\n| Registry                                                                                             | Image                         |\n|------------------------------------------------------------------------------------------------------|-------------------------------|\n| [Docker Hub](https://hub.docker.com/r/crazymax/nextcloud/)                                           | `crazymax/nextcloud`          |\n| [GitHub Container Registry](https://github.com/users/crazy-max/packages/container/package/nextcloud) | `ghcr.io/crazy-max/nextcloud` |\n\nFollowing platforms for this image are available:\n\n```\n$ docker buildx imagetools inspect crazymax/nextcloud --format \"{{json .Manifest}}\" | \\\n  jq -r '.manifests[] | select(.platform.os != null and .platform.os != \"unknown\") | .platform | \"\\(.os)/\\(.architecture)\\(if .variant then \"/\" + .variant else \"\" end)\"'\n\nlinux/amd64\nlinux/arm64\nlinux/ppc64le\nlinux/riscv64\nlinux/s390x\n```\n\n## Environment variables\n\n### General\n\n* `TZ`: The timezone assigned to the container (default `UTC`)\n* `PUID`: Nextcloud user id (default `1000`)\n* `PGID`: Nextcloud group id (default `1000`)\n* `MEMORY_LIMIT`: PHP memory limit (default `512M`)\n* `UPLOAD_MAX_SIZE`: Upload max size (default `512M`)\n* `PM_MAX_CHILDREN`: Maximum number of child processes to be created for PHP-FPM (default `20`)\n* `BODY_TIMEOUT`: Defines a timeout for reading client request body (default `300s`)\n* `CLEAR_ENV`: Clear environment in FPM workers (default `yes`)\n* `OPCACHE_MEM_SIZE`: PHP OpCache memory consumption (default `128`)\n* `LISTEN_IPV6`: Enable IPv6 for Nginx (default `true`)\n* `APC_SHM_SIZE`: APCu memory size (default `128M`)\n* `REAL_IP_FROM`: Trusted addresses that are known to send correct replacement addresses (default `0.0.0.0/32`)\n* `REAL_IP_HEADER`: Request header field whose value will be used to replace the client address (default `X-Forwarded-For`)\n* `LOG_IP_VAR`: Use another variable to retrieve the remote IP address for access [log_format](http://nginx.org/en/docs/http/ngx_http_log_module.html#log_format) on Nginx. (default `remote_addr`)\n\n### Nextcloud\n\n* `HSTS_HEADER`: [HTTP Strict Transport Security](https://docs.nextcloud.com/server/stable/admin_manual/installation/harden_server.html#enable-http-strict-transport-security) header value (default `max-age=15768000; includeSubDomains`)\n* `XFRAME_OPTS_HEADER`: [X-Frame-Options](https://docs.nextcloud.com/server/stable/admin_manual/installation/harden_server.html#serve-security-related-headers-by-the-web-server) header value (default `SAMEORIGIN`)\n* `RP_HEADER`: [Referrer Policy](https://docs.nextcloud.com/server/stable/admin_manual/installation/harden_server.html#serve-security-related-headers-by-the-web-server) header value (default `strict-origin`)\n* `SUBDIR`: [Subdir](https://docs.nextcloud.com/server/stable/admin_manual/installation/nginx.html#nextcloud-in-a-subdir-of-nginx) to use. Read [this section](#running-in-a-subdir) for more info.\n* `DB_TYPE`: Database type (mysql, pgsql or sqlite) (default `sqlite`)\n* `DB_NAME`: Database name (default `nextcloud`)\n* `DB_USER`: Username for database (default `nextcloud`)\n* `DB_PASSWORD`: Password for database user\n* `DB_HOST`: Database host (default `db`)\n* `DB_TIMEOUT`: Time in seconds after which we stop trying to reach the database server. Only used for `mysql` and `pgsql` db type (default `60`)\n\n\u003e [!NOTE]\n\u003e `DB_PASSWORD_FILE` can be used to fill in the value from a file, especially\n\u003e for Docker's secrets feature.\n\n### Cron\n\n\u003e [!WARNING]\n\u003e Only used if you enable and run a [sidecar cron container](#cron-sidecar)\n\n* `SIDECAR_CRON`: Set to `1` to enable sidecar cron mode (default `0`)\n* `CRON_PERIOD`: Periodically execute Nextcloud [cron](https://docs.nextcloud.com/server/stable/admin_manual/configuration_server/background_jobs_configuration.html#cron) (eg. `*/5 * * * *`)\n\n### Previews generator\n\n\u003e [!WARNING]\n\u003e Only used if you enable and run a [sidecar previews generator container](#previews-generator-sidecar)\n\n* `SIDECAR_PREVIEWGEN`: Set to `1` to enable sidecar previews generator mode (default `0`)\n* `PREVIEWGEN_PERIOD`: Periodically execute pre-generation of previews (eg. `0 * * * *`)\n\n### News Updater\n\n\u003e [!WARNING]\n\u003e Only used if you enable and run a [sidecar news updater container](#nextcloud-news-updater)\n\n* `SIDECAR_NEWSUPDATER`: Set to `1` to enable sidecar news updater mode (default `0`)\n* `NC_NEWSUPDATER_THREADS`: How many feeds should be fetched in parallel (default `10`)\n* `NC_NEWSUPDATER_TIMEOUT`: Maximum number of seconds for updating a feed (default `300`)\n* `NC_NEWSUPDATER_INTERVAL`: Update interval between fetching the next round of updates in seconds (default `900`)\n* `NC_NEWSUPDATER_LOGLEVEL`: Log granularity, `info` will log all urls and received data, `error` will only log errors (default `error`)\n\n## Volumes\n\n* `/data`: Contains config, data folders, installed user apps (not core ones), session, themes, tmp folders\n\n\u003e [!WARNING]\n\u003e Note that the volume should be owned by the user/group with the specified\n\u003e `PUID` and `PGID`. If you don't give the volume correct permissions, the\n\u003e container may not start.\n\n## Ports\n\n* `8000`: HTTP port\n\n## Usage\n\n### Docker Compose\n\nDocker compose is the recommended way to run this image. Copy the content of\nfolder [examples/compose](examples/compose) in `/var/nextcloud/` on your host\nfor example. Edit the compose and env files with your preferences and run the\nfollowing commands:\n\n```bash\ndocker compose up -d\ndocker compose logs -f\n```\n\n### Command line\n\nYou can also use the following minimal command:\n\n```bash\ndocker run -d -p 8000:8000 --name nextcloud \\\n  -v \"$(pwd)/data:/data\" \\\n  crazymax/nextcloud:latest\n```\n\n## Upgrade\n\nTo upgrade to the latest version of Nextcloud, pull the newer image and launch\nthe container. Nextcloud will upgrade automatically:\n\n```bash\ndocker compose pull\ndocker compose up -d\n```\n\n## Notes\n\n### First installation\n\nIf you run the container for the first time, the installation will be automatic\nusing the `DB_*` environment variables. Then open your browser to configure\nyour admin account.\n\n### OCC command\n\nIf you want to use the [occ command](https://docs.nextcloud.com/server/stable/admin_manual/configuration_server/occ_command.html)\nto perform common server operations like manage users, encryption, passwords,\nLDAP setting, and more, type:\n\n```bash\ndocker compose exec nextcloud occ\n```\n\n### Cron sidecar\n\nIf you want to enable the cronjob, you have to run a \"sidecar\" container (see\ncron service in [compose.yml](examples/compose/compose.yml) example) or run a\nsimple container like this:\n\n```bash\ndocker run -d --name nextcloud_cron \\\n  --env-file $(pwd)/nextcloud.env \\\n  -e \"SIDECAR_CRON=1\" \\\n  -e \"CRON_PERIOD=*/5 * * * *\" \\\n  -v \"$(pwd)/data:/data\" \\\n  crazymax/nextcloud:latest\n```\n\nAnd do not forget to choose **Cron** as background jobs:\n\n![Background jobs](.github/background-jobs.png)\n\n### Previews generator sidecar\n\nTo execute pre-generation of previews through the [Preview Generator](https://github.com/rullzer/previewgenerator)\nplugin, you have to run a \"sidecar\" container (see cron service in [compose.yml](examples/compose/compose.yml)\nexample) or run a simple container like this:\n\n```bash\ndocker run -d --name nextcloud_previewgen \\\n  --env-file $(pwd)/nextcloud.env \\\n  -e \"SIDECAR_PREVIEWGEN=1\" \\\n  -e \"PREVIEWGEN_PERIOD=0 * * * *\" \\\n  -v \"$(pwd)/data:/data\" \\\n  crazymax/nextcloud:latest\n```\n\n### Nextcloud News Updater\n\nIf you want to enable the [Nextcloud News Updater](https://github.com/nextcloud/news-updater),\nyou have to run a \"sidecar\" container (see news_updater service in\n[compose.yml](examples/compose/compose.yml) example) or run a simple container\nlike this:\n\n```bash\ndocker run -d --name nextcloud_news_updater \\\n  --env-file $(pwd)/nextcloud.env \\\n  -e \"SIDECAR_NEWSUPDATER=1\" \\\n  -e \"NC_NEWSUPDATER_THREADS=10\" \\\n  -e \"NC_NEWSUPDATER_TIMEOUT=300\" \\\n  -e \"NC_NEWSUPDATER_INTERVAL=900\" \\\n  -e \"NC_NEWSUPDATER_LOGLEVEL=error\" \\\n  -v \"$(pwd)/data:/data\" \\\n  crazymax/nextcloud:latest\n```\n\nAnd do not forget to disable **Use system cron for updates** in news settings:\n\n![Background jobs](.github/newsupdater-system-cron-updates.png)\n\n### Email server\n\nYou can use our SMTP relay `msmtpd` service published on port `2500` and\ndeclared in our [`compose.yml`](examples/compose/compose.yml):\n\n![Email server config](.github/email-server-config.png)\n\n### Redis cache\n\nRedis is recommended, alongside APCu to make Nextcloud faster. If you want to\nenable Redis, deploy a redis container (see [compose file](examples/compose/compose.yml))\nand add this to your `config.php`:\n\n```\n    'memcache.local' =\u003e '\\OC\\Memcache\\APCu',\n    'memcache.distributed' =\u003e '\\OC\\Memcache\\Redis',\n    'memcache.locking' =\u003e '\\OC\\Memcache\\Redis',\n    'redis' =\u003e array(\n        'host' =\u003e 'redis',\n        'port' =\u003e 6379,\n    ),\n```\n\n### Running in a subdir\n\nIf you want to access your Nextcloud installation in a subdir (like\n`/nextcloud`), you have to set the `SUBDIR` environment variable and also add\n`PathPrefixStrip:/nextcloud` to your frontend rule if you use Traefik. Do not\nforget to remove `includeSubDomains` option in `HSTS_HEADER` if used.\n\n## Contributing\n\nWant to contribute? Awesome! The most basic way to show your support is to star\nthe project, or to raise issues. You can also support this project by [**becoming a sponsor on GitHub**](https://github.com/sponsors/crazy-max)\nor by making a [PayPal donation](https://www.paypal.me/crazyws) to ensure this\njourney continues indefinitely!\n\nThanks again for your support, it is much appreciated! :pray:\n\n## License\n\nMIT. See `LICENSE` for more details.\n","funding_links":["https://github.com/sponsors/crazy-max","https://www.paypal.me/crazyws"],"categories":["Dockerfile"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrazy-max%2Fdocker-nextcloud","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrazy-max%2Fdocker-nextcloud","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrazy-max%2Fdocker-nextcloud/lists"}