Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Usage Milestone: Google Analytics Module google_analytics crossed 1,000 active installs. Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Release: GraphQL Compose Codegen 1.1.2 Minor update available for module graphql_compose_codegen (1.1.2). Release: Mapy.com 1.1.3 Minor update available for module mapycom (1.1.3). Release: Ckeditor5 entity browser 3.0.3 Minor update available for module ckeditor5_entity_browser (3.0.3). Release: Ckeditor5 entity browser 3.0.1 Minor update available for module ckeditor5_entity_browser (3.0.1). Release: Ckeditor5 entity browser 3.0.2 Minor update available for module ckeditor5_entity_browser (3.0.2). Release: Teamleader Integration 4.0.2 Minor update available for module teamleader (4.0.2). Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

File permissions

32 sites Security covered Drupal 9–11
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.

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
8
Tracked since
Feb 2026
Latest release
6 months ago
Releases (12 mo)
8 ▲ from 0
Maintenance
Slowing

Release Timeline

Releases

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