Note: Make sure to backup your store and dB before performing a Magento upgrade.
Note 2: Backup your .htaccess file,as it is overwritten when you upgrade.
1. Via SSH, issue the commands below in the root of your Magento installation.
php bin/magento deploy:mode:set developer
composer require magento/product-community-edition 2.2.5 --no-update
rm -Rf var/cache/ var/generation/ var/page_cache/ var/view_preprocessed/ var/di;
php bin/magento setup:upgrade
2. Restore your .htaccess file from your backup
For more details about the upgrade process please check the Official Magento 2 Documentation