Unable to install WordPress plugins

I followed this example to set up my wordpress instance.

I am unable to install/ update plugins through the WordPress Admin UI. It keeps asking me for the FTP username/ password, and even after I enter those information, the files are still not installed.

I can upload files through the Media however, so it doesn’t seem like a file permissions issues to me.

Does anyone know what are some possible solutions I can try?

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Use this code , wordpress asking for ftp details because wordpress doesn’t have permission to write in your server. use these two commands in terminal.

$sudo a2enmod rewrite $sudo chown -R www-data /var/www

video guide

This question was answered by @UKn0Me:

After running chown, you’ll probably need to add define('FS_METHOD', 'direct'); to wp-config.php to force it to stop using FTP.

View the original comment