{"id":19237144,"url":"https://github.com/extalionlab/nextcloud_docker","last_synced_at":"2026-03-08T18:31:20.111Z","repository":{"id":39698408,"uuid":"334707354","full_name":"eXtalionLab/nextcloud_docker","owner":"eXtalionLab","description":"Docker setup to run Nextcloud","archived":false,"fork":false,"pushed_at":"2024-12-13T16:20:34.000Z","size":98,"stargazers_count":45,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-16T14:35:47.687Z","etag":null,"topics":["collaboraoffice","collaboraonline","coturn","coturn-docker","docker","docker-compose","nextcloud","nextcloud-docker","nextcloud-talk","self-hosted"],"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/eXtalionLab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-01-31T16:55:23.000Z","updated_at":"2025-03-06T08:34:15.000Z","dependencies_parsed_at":"2022-09-20T08:10:56.719Z","dependency_job_id":"2ed929ac-bee6-4471-b7d9-18edc1325f35","html_url":"https://github.com/eXtalionLab/nextcloud_docker","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/eXtalionLab/nextcloud_docker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eXtalionLab%2Fnextcloud_docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eXtalionLab%2Fnextcloud_docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eXtalionLab%2Fnextcloud_docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eXtalionLab%2Fnextcloud_docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eXtalionLab","download_url":"https://codeload.github.com/eXtalionLab/nextcloud_docker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eXtalionLab%2Fnextcloud_docker/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266427507,"owners_count":23926810,"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","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["collaboraoffice","collaboraonline","coturn","coturn-docker","docker","docker-compose","nextcloud","nextcloud-docker","nextcloud-talk","self-hosted"],"created_at":"2024-11-09T16:24:59.513Z","updated_at":"2026-03-08T18:31:20.066Z","avatar_url":"https://github.com/eXtalionLab.png","language":"Dockerfile","readme":"# Nextcloud\n\nIt's a simply as possible `docker compose` stack to run a\n[Nextcloud](https://www.nextcloud.com) for **development** and for\n**production**.\n\n---\n\n- [Requirements](#requirements)\n- [Run](#run)\n\t- [Fresh run](#fresh-run)\n\t- [Run installed cloud](#run-installed-cloud)\n\t- [Production](#production)\n\t- [Docker envs](#docker-envs)\n\t- [Log level](#log-level)\n- [Improving Nextcloud Previews](#improving-nextcloud-previews)\n- [Full Text Search](#full-text-search)\n- [Collabora online](#collabora-online)\n- [Talk (STUN / TURN)](#talk-stun--turn)\n- [Notify Push](#notify-push)\n- [Reverse proxy](#reverse-proxy)\n- [Backup](#backup)\n- [Update / Deploy](#update--deploy)\n- [Debug](#debug)\n\n## Requirements\n\nTo run this you just need a [docker](https://www.docker.com/get-started/) and\n[docker compose](https://github.com/docker/compose#quick-start).\n\n## Run\n\nYou can install a fresh instance of Nextcloud or restore your already installed\ncloud from dump/backup.\n\n### Fresh run\n\nWhen you want to run fresh instance of nextcloud:\n\n**Extra!** Create a **.env** file (use **.env.dist** as starter file,\n`cp .env.dist .env`) and setup values.\n\n1. Run `docker compose up [-d]`.\n2. Wait for download and build images.\n3. Wait for install a fresh Nextcloud instance.\n4. Stop (`Ctrl+C`) and run `docker compose up` again to correct setup files\npermissions.\n5. Goto [NEXTCLOUD_HOST:NEXTCLOUD_PORT](http://localhost/) domain and play with\nyour new cloud.\n\nYou can also run command to add \"missing\" indexes in the database:\n\n```bash\nbin/occ db:add-missing-indices\n```\n\n### Run installed cloud\n\nWhen you have a dump of your already installed Nextcloud instance:\n\n1. Create a **.env** file (use **.env.dist** as starter file,\n`cp .env.dist .env`) and setup **required** values:\n\t- `MYSQL_DATABASE` (`dbname`),\n\t- `MYSQL_PASSWORD` (`dbpassword`),\n\t- `MYSQL_USER` (`dbuser`),\n\t- `NEXTCLOUD_DEFAULT_PHONE_REGION` (`default_phone_region`),\n\t- `NEXTCLOUD_MAINTENANCE_WINDOW_START` (`maintenance_window_start`),\n\t- `NEXTCLOUD_TRUSTED_DOMAINS` (`trusted_domains`),\n\t- `REDIS_HOST_PASSWORD` (`redis.password`).\nThey should have the same values as in current **config/config.php**.\n2. Move your database dump file(s) into **initdb.d/** directory.\n3. Move your config files into **config/** directory.\n4. Move your custom apps into **apps/** directory.\n5. Move your data files into **data/** directory.\n6. Move your nextcloud files into **nextcloud/** directory.\n7. Run `docker compose up [-d]`.\n8. Wait for download and build images.\n9. Wait when `db` service will load dump file(s) into the database.\n**Note!** When you goto the cloud before database is loaded you will got an\nerror. Please be patient and wait for database.\n10. Goto [http://localhost/](http://localhost/) domain and play with your new\ncloud.\n\n### Production\n\nIf you want to run **prod**uction environment\n\n1. Uncomment line `#COMPOSE_FILE=compose.yml:compose.prod.yml` in **.env**\nfile. It tells to `docker compose` to use those files instead of default\n**docker compose.yml** and  **docker compose.override.yml** (they're good for\n**dev**elopment).\n2. Rebuild images with `docker compose build [--pull]`.\n3. Run new stack `docker compose up [-d]`.\n\n### Docker envs\n\n`NEXTCLOUD_HOST` allow to change a host on which `nginx` services is\nlistening. Default it's `127.0.0.1` so only you can connect from your local\nmachine to the cloud. Setup `0.0.0.0` to allow others from the same network to\nconnect to your cloud (for example to test cloud on your mobile).\n\nOther environments are described\n[here](https://github.com/nextcloud/docker/tree/master#auto-configuration-via-environment-variables).\n\n### Log level\n\nTo \"increase\" performance you can set log level to `error`:\n\n```bash\nbin/occ log:manage --level=error\n```\n\n### Development mailer\n\nIn **dev** environment you can use `mailer` service to catch all emails sent. In\n**Basic settings** setup:\n\n- `Send mode` to `SMTP`,\n- `Encryption` to `None`,\n- `From address` to your email address,\n- `Server address` to `mailer` and port to `1025`.\n\nClick `Send email` to test if it works.\n\n## Improving Nextcloud Previews\n\nAccording to this [article](https://ownyourbits.com/2019/06/29/understanding-and-improving-nextcloud-previews/)\nPreview mechanism need some tuning.\n\nInstall Nextcloud [app](https://apps.nextcloud.com/apps/previewgenerator) and\nsetup recommended configurations:\n\n```bash\nbin/occ config:app:set previewgenerator squareSizes --value=\"32 256\"\nbin/occ config:app:set previewgenerator widthSizes  --value=\"256 384\"\nbin/occ config:app:set previewgenerator heightSizes --value=\"256\"\nbin/occ config:system:set preview_max_x --value 2048\nbin/occ config:system:set preview_max_y --value 2048\nbin/occ config:system:set jpeg_quality --value 60\nbin/occ config:app:set preview jpeg_quality --value=\"60\"\n```\n\nIf you want to start from scratch you can delete preview folder:\n\n```bash\nrm -rf ./data/appdata_*/preview\n```\n\nAnd regenerate previews first time by:\n\n```bash\nbin/occ preview:generate-all -vvv\n```\n\n## Full Text Search\n\nTo improve search result we can install:\n\n- [fulltextsearch](https://apps.nextcloud.com/apps/fulltextsearch)\n- [files_fulltextsearch](https://apps.nextcloud.com/apps/files_fulltextsearch)\n- [fulltextsearch_elasticsearch](https://apps.nextcloud.com/apps/fulltextsearch_elasticsearch)\n\nWe have to run `elasticsearch` service. Add `:docker/elasticsearch/compose.yml`\nto `COMPOSE_FILE` environment.\n\nGoto [settings](http://localhost:80/settings/admin/fulltextsearch), select\n`Elasticsearch` from select box, as an address type `http://elasticsearch:9200`\nand setup index to `nextcloud_index`.\n\nFor first index run:\n\n```bash\nbin/occ fulltextsearch:index\n```\n\n## Collabora online\n\nIf you want to run collabora online locally and you don't have a reverse proxy,\nyou have to add `nginx` and `collabora` to your **/etc/hosts**:\n\n```bash\n127.0.0.1 collabora\n127.0.0.1 nginx\n```\n\nFor nextcloud (docker service) collabora is available under `collabora` host and\nit has to be the same host for a client (your browser).\n\nFor collabora (docker service) nextcloud is available under `nginx` host and you\nhave to access nextcloud instance via [http://nginx:$NEXTCLOUD_PORT](http://nginx:80).\n\n---\n\nWe have to run `collabora` service. Add `:docker/collabora/compose.yml` to\n`COMPOSE_FILE` environment.\n\nYou can also change/setup other environments in **.env** file:\n\n```bash\n###\u003e Collabora ###\nCOLLABORA_PORT=9980\n\n# Go and read https://www.collaboraoffice.com/code/docker/and\n# https://github.com/CollaboraOnline/online/blob/master/docker/from-packages/scripts/start-collabora-online.sh\n# to see all env\n\nCOLLABORA_DICTIONARIES=en\n# Value other then \"set\" will disable warning/info messages of LOKit\nCOLLABORA_SAL_LOG=set\n# Value other then \"set\" won't generate ssl cert\nCOLLABORA_DONT_GEN_SSL_CERT=\nCOLLABORA_CERT_DOMAIN=collabora\n# Collabora domain (without reverse proxy it's docker service)\nCOLLABORA_SERVER_NAME=collabora:9980\n# Nextcloud domain (without reverse proxy it's docker service)\nCOLLABORA_DOMAIN=nginx\n# Extra loolwsd command line parameter. To learn about all possible options,\n# refer to the self-documented /etc/loolwsd/loolwsd.xml\n#   docker compose exec collabora cat /etc/loolwsd/loolwsd.xml\nCOLLABORA_EXTRA_PARAMS=--o:admin_console.enable=false --o:ssl.enable=false\n# To enable the admin console feature of CODE remove admin_console.enbale option\n# $COLLABORA_SERVER_NAME/loleaflet/dist/admin/admin.html\nCOLLABORA_USERNAME=root\nCOLLABORA_PASSWORD=CHANGE_ME\n###\u003c Collabora ###\n```\n\nInstall [richdocuments](https://apps.nextcloud.com/apps/richdocuments),\ngoto [settings](http://nginx:80/settings/admin/richdocuments), select\n`Use your own server` and as an url put `http://collabora:9980`.\n\n**Done!**\n\n## Talk (STUN / TURN)\n\nIf you have install talk [app](https://apps.nextcloud.com/apps/spreed) and you\nwant to \"increase\" performance and have video calls, you have to set up your own\nSTUN/TURN server.\n\nWe have to run `coturn` service. Add `:docker/coturn/compose.yml` to\n`COMPOSE_FILE` environment.\n\nYou can also change/setup other environments in **.env** file:\n\n```bash\n###\u003e Coturn ###\nCOTURN_PORT=3478\nCOTURN_SECRET=CHANGE_ME\n# Your nextcloud domain\nCOTURN_REALM=localhost\n###\u003c Coturn ###\n```\n\nGoto [settings](http://localhost:80/settings/admin/talk) and set:\n\n- `STUN server` to `your-server-ip:$COTURN_PORT`,\n- `TURN server` to `your-server-ip:$COTURN_PORT`,\n- `TURN secret` to `$COTURN_SECRET`.\n\n## Notify Push\n\nTo configure [notify_push](https://github.com/nextcloud/notify_push) app:\n\n- Install the `notify_push` app from the appstore,\n- Restart `nextcloud` service (`docker compose restart nextcloud`),\n- set the url of the push server (`bin/occ notify_push:setup http://domain/push`)\n\nIf you got **push server is not a trusted proxy** then you have to add displayed\nproxies in **config/config.php** to `trusted_proxies`.\n\n## Reverse proxy\n\nBasic nginx configuration for reverse proxy is available\n[here](https://www.digitalocean.com/community/tools/nginx?domains.0.server.domain=nextcloud.example.com\u0026domains.0.server.redirectSubdomains=false\u0026domains.0.https.hstsPreload=true\u0026domains.0.php.php=false\u0026domains.0.reverseProxy.reverseProxy=true\u0026domains.0.reverseProxy.proxyPass=http%3A%2F%2F127.0.0.1%3A%24NEXTCLOUD_PORT\u0026domains.0.routing.root=false\u0026domains.0.logging.accessLog=true\u0026domains.0.logging.errorLog=true\u0026domains.1.server.domain=collabora.example.com\u0026domains.1.server.redirectSubdomains=false\u0026domains.1.https.hstsPreload=true\u0026domains.1.php.php=false\u0026domains.1.reverseProxy.reverseProxy=true\u0026domains.1.reverseProxy.proxyPass=http%3A%2F%2F127.0.0.1%3A%24COLLABORA_PORT\u0026domains.1.routing.root=false\u0026domains.1.logging.accessLog=true\u0026domains.1.logging.errorLog=true).\n\nUpdate `Server \u003e Domain` names and `Reverse proxy \u003e proxy_pass` ports (read\nports from your **.env** file).\n\nRemove `include nginxconfig.io/security.conf;` from nextcloud domain conf.\nDocker nginx service conf is build base on\n[Nextcloud example](https://github.com/nextcloud/docker/blob/master/.examples/docker compose/insecure/mariadb-cron-redis/fpm/web/nginx.conf).\n\nIn **.env** file you have to change:\n\n```bash\nNEXTCLOUD_TRUSTED_DOMAINS=nextcloud.example.com\nCOLLABORA_CERT_DOMAIN=collabora.example.com\nCOLLABORA_SERVER_NAME=collabora.example.com\nCOLLABORA_DOMAIN=nextcloud.example.com\n```\n\nIf you have install nextcloud already, in **./config/config.php**:\n\n- add `nextcloud.example.pl` to `trusted_domains` array,\n- change `overwrite.cli.url` to `nextcloud.example.pl`.\n\nIf you have setup collabora online, you have to update\n`URL (and Port) of Collabora Online-server` to `collabora.example.com`.\n\nReload docker:\n\n```bash\ndocker compose up [-d]\n```\n\n## Backup\n\nTo make a backup we're using a\n[docker-backup](https://github.com/eXtalionLab/docker-backup) tool which use\n[BorgBackup](https://www.borgbackup.org/) under hood.\n\nCreate a **.docker-backup** file (use **.docker-backup.dist** as starter file,\n`cp .docker-backup.dist .docker-backup`) and setup values. Refer to\n[documentation](https://github.com/eXtalionLab/docker-backup#docker-backup).\n\n## Update / Deploy\n\nSetup `COMPOSE_FILE` to `docker compose.yml:docker compose.prod.yml`. Also if\nyou want to run other services (`elasticsearch`, `collabora`, `coturn`) add their\n**compose.yml** too. See\n[here](https://docs.docker.com/compose/environment-variables/envvars/#compose_file).\n\nUpdate images names prefix (**.env** `IMAGES_PREFIX`) which point to your hub.\n\nRun:\n\n```bash\ndocker compose build --pull\n```\n\nIf you didn't build images on the server run:\n\n```bash\ndocker compose push\n```\n\nOn the server run:\n\n```bash\ndocker compose pull\ndocker compose up -d\n```\n\n## Debug\n\nIf you want to debug a cloud with [xdebug](https://xdebug.org/):\n\n- be sure you're running **dev** environment (and images),\n- add/setup `debug` to `XDEBUG_MODE`,\n- reload docker with `docker compose up -d`.\n\nNow you're ready to remote debugging.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fextalionlab%2Fnextcloud_docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fextalionlab%2Fnextcloud_docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fextalionlab%2Fnextcloud_docker/lists"}