When you setup a WordPress on Ubuntu Linux and try to install a new plugin from plugin repository it prompts you for FTP Details.
With a few Google searches I managed to find a solution for this problem. To fix this issue all you need to do is run the following command on your terminal.
sudo chown -R www-data:www-data /[folder-path]/[name-of-your-project-folder]
You can also fix this issue by adding following line to your wp-config.php file.