Note: Make sure to backup your store and dB before performing a Magento upgrade.
Note 2: Backup your .htaccess file, this file is overwritten when you upgrade.
1. Via SSH issue below commands 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 Official Magento 2 Documentation