Featured Application This article presents real-time power management including an optimization problem, formulated as mixed-integer linear programming, for a microgrid-based intelligent infrastructure for recharging electric vehicles (EVs). The DC microgrid includes photovoltaic sources, stationary storage, a power grid connection, and EV batteries as load. The objective of the optimization problem is to minimize the total energy cost. Simulation and real-time experimental results under different meteorological conditions prove the feasibility of the proposed control and its superiority over the storage priority strategy. Electric vehicles (EVs) are expanding quickly and widely, and, therefore, EVs can participate in reducing direct greenhouse gas emissions. The intelligent infrastructure for recharging EVs, which is microgrid-based, includes photovoltaic (PV) sources, stationary storage, and a grid connection as power sources. In this article, the energy cost optimization problem is studied, taking into account the intermittent arrival and departure of EVs. A mixed-integer linear programming is formulated as an optimization problem in a real-time operation to minimize the total energy cost, taking into consideration the physical limitations of the system. The interaction with the human-machine interface provides EV data in real-time operation, and the prediction only communicates the PV prediction profile provided by the national meteorological institute in France. The optimization is executed at each EV arrival, with the actualized data in the DC microgrid. Simulation and real-time experimental results of different meteorological conditions show that the EV user demands are satisfied, proving the feasibility of the proposed optimization problem for real-time power management.