In a Microgrid, the integration of many tasks makes possible an adequate energy management system. Jobs involving real-time support and information procession for having an autonomous and scalable management system, and others such as massive storage capabilities and security considerations to guarantee reliability and validity, are a few. This paper considers them to propose a real-time energy management system based on the economic dispatch problem under a cloud-based architecture, ensuring the appropriately supervised learning functionality in a Microgrid cluster. Namely, it was necessary to revise and run Microgrid implementations, integrate real-time simulation platforms, connect to a virtual server from a Microgrid control, and set the energy management system using cloud computing and machine learning. Based on the results, this article presents a scalable and autonomous cloud-computing architecture for a real-time energy management system using machine learning techniques that allows power generation and energy consumption prediction.