Skip to content
XeveAbout code and problems

Changing the maximum upload file size with Nextcloud in a docker-compose setup

January 3, 2023 0 comments Article Uncategorized nspo

The Nextcloud documentation as of today does not mention how to adjust the settings for uploading large files when using Nextcloud in a docker-compose setup (or generally in a Docker container). It does mention, however, that the following PHP settings need to be adjusted:

php_value upload_max_filesize 16G
php_value post_max_size 16G

So the issue is reduced to finding out how these values can be changed for the container running the Nextcloud image in the simplest way.

Most of the sites I found while trying to solve this recommend adding or changing an ini file in the container (e.g. setting up a bind mount). But this can actually be solved in a much simpler and potentially less fragile way! Check out this excerpt from an nextcloud.ini file inside the main Nextcloud container:

$ sudo docker exec -it nextcloud_app bash
root@42b3ec8ee31f:/var/www/html# grep -E '(upload_max_filesize|post_max_size)' /usr/local/etc/php/conf.d/nextcloud.ini 
upload_max_filesize=${PHP_UPLOAD_LIMIT}
post_max_size=${PHP_UPLOAD_LIMIT}

So the relevant settings are automatically adjusted when you set the PHP_UPLOAD_LIMIT environment variable. You can easily do this in your docker-compose.yml like this:

services:
  # ...
  app:
    image: nextcloud:apache
    container_name: nextcloud_app
    # ...
    environment:
      # ...
      - PHP_UPLOAD_LIMIT=16G
    # ...

Afterwards, the System page in Nextcloud’s administration menu should show something like this:

By the way: the reverse proxy that redirects client requests to the actual application container also has to support large file uploads. But this is already configured by default when using Nextcloud’s sample docker-compose setup.

Tags: docker, docker-compose, file size, large files, nextcloud, php

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • Spanish Juggling problem
  • Changing the maximum upload file size with Nextcloud in a docker-compose setup
  • Shrinking a QNAP Virtualization Station disk image
  • Indexed Priority Queue in C++
  • Efficient Union-Find in C++ – or: Disjoint-set forests with Path Compression and Ranks

Recent Comments

  • Andreas on Shrinking a QNAP Virtualization Station disk image
  • Arjun on Fix for Latex4CorelDraw with CorelDraw 2017
  • Nigel De Gillern on No wired (LAN) connection in Linux, although everything looks right
  • Harald H on Automatically reboot TP-Link router WDR4300 / N750 with bash script
  • Gene on Running multiple Django projects on one Apache instance with mod_wsgi

Archives

  • January 2023
  • December 2022
  • January 2021
  • May 2020
  • April 2020
  • July 2018
  • May 2018
  • April 2018
  • March 2018
  • September 2015
  • August 2015
  • June 2015
  • March 2015
  • February 2015
  • September 2014
  • March 2013

Categories

  • Uncategorized

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Copyright Xeve 2025 | Theme by ThemeinProgress | Proudly powered by WordPress