php bin/magento deploy:mode:set production
You may see this error:-
Command returned non-zero exit code:
The error is most likely related to the PHP memory_limit.
Make sure you set it to at least 768M and it should work.
If it still doesn't work for you, you can always skip Compilation and do it later:-
php bin/magento deploy:mode:set production --skip-compilation