Raddy Website Design & Development Tutorials

AWS LightSail Fix WordPress File permissions

By Raddy in Other / WordPress ·

Recently I moved this WordPress website from one Lightsail instance to another. As soon as I moved the website I noticed permission issues. I couldn’t update any of the plugins, and some of them came up with permission errors. On top of that, I noticed that I couldn’t update files using SFTP. It was giving me similar errors – permission denied.

Fix

1) Find your current bitnami folder structure

You can do that by connecting with SFTP. All you need to know is where your WordPress files are stored. In my latest case, they were under “opt/bitnami/wordpress/”.

2) Open Terminal in AWS

Log in to your AWS account and click on the orange terminal button.

aws wordpress premissions fix

This will open a Terminal window.

2) Change File and Folder permissions

Once you have the Terminal window open, you need to run the following commands, one by one.

sudo chown -R bitnami:daemon /bitnami/wordpress/
sudo find /bitnami/wordpress/ -type d -exec chmod 775 {} \;
sudo find /bitnami/wordpress/ -type f -exec chmod 664 {} \;
sudo chmod 640 /opt/bitnami/wordpress/wp-config.php

OR

sudo chown -R bitnami:daemon /opt/bitnami/wordpress/
sudo find /opt/bitnami/wordpress/ -type d -exec chmod 775 {} \;
sudo find /opt/bitnami/wordpress/ -type f -exec chmod 664 {} \;
sudo chmod 640 /opt/bitnami/wordpress/wp-config.php

Once you run each command, that should fix the problem. You don’t need to restart.

I hope this helps.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.