Using technologies such as anaerobic digestion for energy generation from wastewater demands a change in infrastructure that several treatment works are not prepared to immediately implement. This works explores the use of energy production technologies to increase the sustainability of conventional aerobic wastewater treatment plants. The first option considered sludge (a by-product from wastewater treatment) as raw material for biodiesel production as Fatty Acid Methyl Esters (FAME). The second option consisted of the addition of microalgae during aerobic wastewater treatment and subsequent harvesting of combined microalgae–sludge to produce biodiesel. Results showed that microalgae were able to grow in aerobic wastewater treatment reactors, reaching maximum growth after 6 days. The use of microalgae did not statistically affect chemical oxygen demand removal but provided benefits on ammonia removal (100% removal vs 68 ± 9% when microalgae were not added). Activated sludge contained fewer lipids (13 ± 3%, by dry weight) than the microalgae–sludge mixture (20.8 ± 4.5%). Hence, FAME production when using microalgae–sludge was higher (51.12 ± 12 mg of FAME/g of dry microalgae–sludge) than when using activated sludge (25.6 ± 7 mg of FAME/g of dry activated sludge). This work showed that producing biodiesel from microalgae grown in conjunction with bacteria during aerobic wastewater treatment can reduce energy use and carbon emissions produced by 18.6 and 26.5%, respectively.