In this study, we propose a hybrid solar-anaerobic digestion system for a cleaner energy in the building sector. This system offers sustainable treatment of organic waste, utilizing waste generated by residential buildings. We conducted an investigation into the energy, economic, and environmental aspects of integrating a hybrid solar anaerobic digester treating kitchen waste (KW) and blackwater (BW) into Moroccan residential buildings under different climatic conditions. Two building categories were considered: buildings compliant with Moroccan thermal regulations of construction (MTRC), and non-compliant buildings, which represent the majority in Morocco. Results indicate that the proposed hybrid system, utilizing only waste generated by the building, can, on average, satisfy approximately 26 % of the total heating, cooling, and electricity needs of the considered MTRC non-compliant buildings. As for the MTRC compliant buildings, about 30 % of the total energy needs are met. Simulation outcomes also demonstrate that increasing the quantity of organic waste enhances system autonomy, allowing it to meet 100 % of the energy demand of the studied buildings. Excess heat energy generated by the hybrid system was allocated to the buildings' thermal and domestic hot water demands. Furthermore, the study highlights the significant influence of fixed costs and waste quantity on the system's profitability. Environmental benefits were also evident, with the designed hybrid system reducing CO2 emissions by 66 % compared to using grid electricity.