I have installed magento on the localhost by using XAMPP.
After completing all steps I am getting below error,
Class Magento\User\Model\UserFactory does not exist
You need to remove var/generation folder if your Magento version is less than Magento 2.2 and if your Magento version is Magento 2.2.* You need to remove generated folder except .htacess file and clear cache.
This issue also occured for me with a fresh install of bitnami's magento 2.2.3 virtual machine/appliance.
I can confirm that pooja_kumari's solution worked in this case, too.