linux – Directory and file permissions

I just installed a new server with Ubuntu 20, and after applying permissions to the directory structure I got the error “Installation failed: Could not create the directory”

Usually these are the ones I use for the whole structure:

sudo chown -R linuxUser:ApacheUser 
sudo find . -type d -exec chmod 755 {} +
sudo find . -type f -exec chmod 644 {} +
sudo chmod 400 wp-config.php

Taken from the wordpress codex (, but they don’t work, I still get errors. The ones that do work, and I think they are a bit high, are 775 for directories and 664 for files.

Does anyone have an explanation for this?

Greetings and thanks