Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). UI Patterns (SDC in Drupal UI) 2.0.18 Minor update available for module ui_patterns (2.0.18). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

File permissions

36 sites Security covered
View on drupal.org

This project provides Drush commands to automatically set up and maintain correct file permissions for your Drupal site's files directories. It ensures that the `sites/default/files` and `sites/default/private` directories are writable, creating them and their necessary `.htaccess` files if they don't exist. This helps resolve common Drupal warnings about un-writable directories.

Please note THIS IS NOT A UI MODULE. IT PROVIDES DRUSH COMMANDS ONLY. Please follow instructions below.

This is a set of drush commands for setting up correct file permissions in your Drupal instance. It takes care of creating sites/default/files and sites/default/private on your Drupal installation and updating them in config, so you don't have to do that through the UI. It also takes care of creating .htaccess files in those subdirectories. But most importantly it maintains correct permissions on those directories.

When would you need this?

You might be seeing one of the below notices:

The directory sites/default/files is not writable.
The directory sites/default/private is not writable.
You may need to set the correct directory at the file system settings page
or change the current directory's permissions so that it is writable.

Requirements

  • Drupal 9, 10 or 11
  • Drush 10, 11, 12 or 13

Installation

  1. Download module using Composer:
    composer require drupal/file_permissions
  2. Enable the module:
    drush en file_permissions

How To Use It

By simply running drush fp

Optionally, if auto-detection of the web server user and group fails, you can
provide them manually:
drush fp --user=www-data --group=www-data

To preview changes without applying them:
drush fp --dry-run

It is not recommended to use it with sudo as it
will create files owned by the root user.

Note

Because this is all about permissions, a root user is required, that's why it will ask you for sudo access.

Activity

Total releases
8
First release
Feb 2026
Latest release
4 months ago
Releases (12 mo)
8 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Release date
2.1.3 Stable Feb 28, 2026
2.1.2 Stable Feb 28, 2026
2.1.1 Stable Feb 27, 2026
2.1.0 Stable Feb 27, 2026
2.0.0 Stable Feb 27, 2026
2.0.0-beta3 Pre-release Feb 27, 2026
2.0.0-beta2 Pre-release Feb 26, 2026
2.0.0-beta1 Pre-release Feb 26, 2026