Search code examples
wordpressamazon-ec2pem

How to setup wordpress to use ftps with pem file?


On AWS Lightsail/EC2, there is a WordPress instance that is unable to upload images/templates/plugins from within WordPress.

I have been able to FTP into this instance with Filezilla and also ssh with bash. But the upload functionality inside WordPress needs to work.

When trying to install a new theme from within WordPress, it asks for ftps credentials. AWS requires the use of a pem file. The WordPress ui does not have the option of using a pem file.

The solution seems to be something like this, but I don't know the actual commands and steps: SSH in, create a user, give them access to something, create a new pem file, and tell WordPress to use the pem file via the FTP section in the wpconfig file.

The file structure is ~/htdocs/{wordpressFiles}

enter image description here


Solution

  • It sounds like you created the folder via FTP thus the FTP User is the file owner, so Apache cannot access it.

    1.) Check if the main user is daemon or bitnami with ls -l

    2.) If the user is not daemon you can try sudo chown daemon:daemon path/to/wp-plugins