Add the following code to wp-config.php. Change the credentials below with the ones you use to connect to your FTP server.
define( 'FTP_USER', 'username' ); define( 'FTP_PASS', 'password' ); define( 'FTP_HOST', 'ftp.example.org:21' ); define('FTP_SSL', false);
Note: change FTP_SSL to true is your FTP connection must be done via SSL (SFTP/TLS).
Source: https://wordpress.org/support/topic/wp-asking-for-my-ftp-credentials-to-install-plugins