Nextcloud AIO Docker change php memory limit values

Hi there,

I’m trying to increase the php memory limit inside my Nextcloud AIO docker install and have had no idea where the php.ini file is stored. If someone could let me know where it’s stored that would be great as there’s no documentation stating the location that I’ve found

Hi @tekkifygamer

For the official Docker Nextcloud build, you can pass the limits to the container via environment variables ()

Maybe this also works with the AIO Nextcloud.

Assuming you are using docker-compose to start your containers, it could look something like this:

    image: nextcloud
    restart: always
      - 8080:80
      - db
      - nextcloud:/var/www/html
      - PHP_MEMORY_LIMIT=1024M
      - PHP_UPLOAD_LIMIT=1024M

1024M is just an example as both are 512M by default. You, however, need to adjust them to fit your needs and the available memory on your server.

I am sorry, I am not a docker expert. I have read a docker tutorial, but am still not sure how to do that …
Are you saying that I have to run docker stop nextcloud-aio-mastercontainer ?
And then I spin up a container from a new image with the environment variables you listed above?:

docker run \
--sig-proxy=false \
--name nextcloud-aio-mastercontainer \
--restart always \
--env NEXTCLOUD_MOUNT=/localdata/ \
--env NEXTCLOUD_DATADIR=/localdata/nextcloud \
--env PHP_MEMORY_LIMIT=1024M \
--env PHP_UPLOAD_LIMIT=1024M \
--publish 80:80 \
--publish 8080:8080 \
--publish 8443:8443 \
--volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \
--volume /var/run/docker.sock:/var/run/docker.sock:ro \

yes, stop and remove it and then use the command that you’ve written down.

1 Like

Thanks! :slight_smile:
Seems to have worked, it’s much faster.