- Newest
- Most votes
- Most comments
This is a common issue with WordPress on Lightsail, particularly related to file permissions and ownership in the wp-content directory.
The error "Installation failed: Could not create directory" occurs because WordPress doesn't have the necessary permissions to write to the plugins directory. This is likely because the web server user (typically www-data or daemon) doesn't have write permissions to the wp-content directory.
To fix this issue, you'll need to modify the permissions of your wp-content directory. Here's how you can do it safely through SSH:
-
Connect to your Lightsail instance using the browser-based SSH client from the Lightsail console.
-
Run the following command to change the permissions of the wp-content directory and its contents:
chmod -R 775 /opt/bitnami/wordpress/wp-content
This command recursively (-R) changes the permissions of the wp-content directory and all files and subdirectories within it to 775, which allows the owner and group to read, write, and execute, and others to read and execute.
If this doesn't resolve the issue, you might also need to check if the destination directories for plugins exist and ensure they have the correct ownership. The Bitnami WordPress stack typically uses a specific user and group for file ownership.
After making these changes, try installing plugins again from your WordPress dashboard. The permission changes should allow WordPress to create directories and install plugins successfully.
Sources
Wordpress Site on AWS Lightsail LAMP instance is up HOWEVER, media upload attempts are met with "Unable to create directory wp-content/... Is its parent directory writable by the server?" How to fix?? | AWS re:Post
Relevant content
- AWS OFFICIALUpdated 2 years ago

I prefer to wait for a human expert answer to confirm the right commands, since I already had issues with permissions before.
The AI command is accurate. It is also correctable if it causes other issues. But I think some previous command must have put it in this state.
If you run
ls -ld -- /opt/bitnami/wordpress/wp-content/you should see something likedrwxrwxr-x 8 bitnami daemon 4096 Nov 18 16:35 /opt/bitnami/wordpress/wp-content/. The important fields here aredrwxrwxr-x,bitnami, anddaemon. If those three fields are correct, your instance should be good to go.