Joomla 4/5 User Manual
What are the recommended file and directory permissions?
This article describes filesystem permissions under UNIX-type operating systems.
Permissions are a common source of trouble in Windows as well, especially under the IIS webserver. Find that information at IIS And Joomla.
Depending on the security configuration of your Web server the recommended default permissions of 755 for directories and 644 for files should be reasonably secure.