In response to infection, macrophages adapt their metabolism rapidly to enhance glycolysis and fuel specialized antimicrobial effector functions. Here we show that fungal melanin is an essential molecule required for the metabolic rewiring of macrophages during infection with the fungal pathogen Aspergillus fumigatus. Using pharmacological and genetic tools, we reveal a molecular link between calcium sequestration by melanin inside the phagosome and induction of glycolysis required for efficient innate immune responses. By remodeling the intracellular calcium machinery and impairing signaling via calmodulin, melanin drives an immunometabolic signaling axis towards glycolysis with activation of hypoxia-inducible factor 1 subunit alpha (HIF-1α) and phagosomal recruitment of mammalian target of rapamycin (mTOR). These data demonstrate a pivotal mechanism in the immunometabolic regulation of macrophages during fungal infection and highlight the metabolic repurposing of immune cells as a potential therapeutic strategy.