With Drupal 7, when I upload a project from local to server, I usually run fix-permisions shell script to change owner and permissions of folder/files.

Is provided in : https://www.drupal.org/node/244924#script-based-on-guidelines-given-above

This script, may not work with Drupal 8, I had some trouble when running it.

Is there something similar to Drupal 8 version?

  • 1
    Welcome to Drupal Answers! It's always a good idea to see if the problem has been solved before, by googling "Drupal 8 fix permissions script" I found, gist.github.com/GreenSkunk/c19b450a6060c8e6e59877a6b1e5f7a8. Thanks :)
    – user72672
    Sep 13, 2019 at 9:21
  • Have you tested it? This script (that I saw, as u said, googling) is not official and no posted in Drupal sites. If someone knows it works ok would be great. Thanks Sep 13, 2019 at 11:20
  • Yep, 404 after running it. I,m trying to know if the problem is on my server config, drupal files, script or where. Sep 13, 2019 at 11:52

2 Answers 2


Finally, after some tries and fixes in Server config, I solve the problem running the shell script provided in:


It works in version 8 correctly as it do in version 7.


Here you can find a script that fixes permissions on Drupal installations: https://github.com/Metadrop/drupal-fix-permissions-script

Permissions scheme:

The scripts tries to secure the site using the following scheme:

  • Code is owned by the deploy user and by the web server's group. Deploy user can write, web server group only read.

  • Content is owned using the same scheme but the web server can write as well.

  • Other users have no permissions on content or code.


The scripts checks if the target folder is a Drupal installation and stops if it is not detected.

Once checked, it fixes the ownership of all folder and files (because it is the same for content and code). Then, it fixes the code and later the content.

The script assumes that files and private folders under sites are content folders.

If there are content folders outside the Drupal root folder you can use the --files-path option and the script will take care of it.


The script only changes the files and folder with the wrong permissions or ownership, making it very fast when only a few files or folders need a fix. For really big installations this is very important as other scripts apply the permissions and ownership regardless are needed o not.

DISCLAIMER: I'm the author of the script.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.