If you are beginning, don't make things too complicated. Start with a modest configuration, like the 2 vCPU / 4 GB RAM suggested by others, one machine for both the web server and the database server, install Moodle, run the Moodle benchmark https://moodle.org/mod/forum/discuss.php?d=335357 and report back.
That is the whole point of virtualization, you can easily add more resources, if necessary.
Hardware and performance
requirments for moodle server
This discussion has been locked so you can no longer reply to it.