Continued growth in the global human population and the high per capita food consumption renders it necessary to provide secure and sustainable food production systems. As current food production systems are vast users of energy and water resources, one of the most important goals achieved in this study is to contribute towards the development of sustainable and resilient energy systems for dairy farming. In this context, a novel multigeneration system is proposed in this study utilising renewable energy (solar and waste biomass) within the dairy farm. Accordingly, a comprehensive thermodynamic analysis of energy and exergy is conducted to assess the cycle's and component’s performances. The subsystems used in the system are; biomass gasifier, parabolic trough collectors, reheat organic Rankine cycle, Brayton cycle, water treatment unit and LiBr-Water absorption cooling system. Gasifier and solar parabolic trough collectors are integrated into a multigeneration system, which generates several outputs (electricity, hot water, hot air, milk evaporation, and a water filtering). The system's net power production and desalinated water can satisfy the farm's necessary energy and water requirements and provide for at least nine-hundred neighbouring houses. The system's overall energy and exergy efficiencies are calculated to be 81.6% and 42.75%, respectively.