WordPress asking for FTP Credentials while installing plugin/theme – digital ocean

This happens due to permission issue to the folder( wp-content ). follow the below steps to resolve the issue.

  1. login to your droplet/instance with root user
  2. Copy code to wp-config.php file
  3. define('FS_METHOD','direct');
  4. go to the root folder of the project ( Mostly its /var/www/html or project folder ).
  5. copy below command and run in the console.
 (sudo)  chown -R www-data:www-data wp-content

That’s it. Happy coding 🙂