Howto tune php-fpm values when using docker


i’m currently trying to improve my nextcloud’s performance by tweaking settings as advised in the Nextcloud manual. According to the manual ( i should set the php-fpm values accordingly.

But how do i do this, when I’m using the official docker image (currently using the image nextcloud:16)?

I already searched within the running container image for the mentioned www.conf file, but could’nt find it.

Any ideas?



In a standard Debian installation the fpm config files would be in
Perhaps you have a corresponding directory in your docker container?

it’s there:

to add your own tweak.php just create a volume -v tweak.php:/usr/local/etc/php/conf.d/tweak.php within docker run or docker-compose.

Ok, thanks that seems to be the solution. I’ll try it out.

EDIT: Yes that worked very well. Thanks!

Does this apply to the normal (apache) nextcloud container? e.g. nextcloud:20

Hi sorry for the late reply. I can’t really tell, but you can check if your container has those files and is running the php-fpm process.

Check this post also: Do I need PHP-FPM?

i guess /usr/local/etc/php/conf.d/ in the container is the place of all php ini files.

Thanks, yes this is the correct location for php-related settings.

Like @mfreudenberg I was going through the “Server Tuning” section of the admin manual and stumbled upon “Tune PHP-FPM”.
When I read up on it I came to the same conclusion as here:

So basically Apache is using mod_php for parallel processing and Nginx is using php-fpm.

Then @mfreudenberg seemed to have some success on changing the settings for php-fpm with the standard docker container.

This is why I was wondering if I missed something.
I tried setting these values myself but didn’t notice any significant performance difference.

This reddit post suggests to replace the mod_php with php-fpm.
This of course does not make sense with docker and the option would be to change to the fpm image (running Nginx as far as I know).

I don’t currently want to mess with my Nextcloud install as the performance is not too bad and I read about some security concerns regarding Nginx.
I may give it a try in the future though.

If somebody has tried both versions I would appreciate any further insights into this.