The idea of sustainable cities and communities is a collective goal that runs across intergovernmental programs, like the United Nations Sustainable Development Goals and the African Agenda 2063 strategic framework. However, with several communities in sub-Saharan Africa and some parts of Asia having no access to electricity, this objective is still a "mirage ". Developing a resilient energy system for an unelectrified community should involve a thorough assessment and integration of the local energy resources in a decentralized generation and distribution system. For example, technologies that convert the waste generated in the community into biogas should be a part of microgrid systems. This paper thus proposes a microgrid solution for small communities where a combination of waste-to-energy, battery storage, and solar photovoltaic technologies can provide enough energy needed for the sustainable development of local communities. An unelectrified village in Nigeria has been selected as a case study. The energy demand for the village was carefully analyzed as 574 kWh/day. Techno-economic analysis of the hybrid solar PV/biogas/diesel system fit to serve this load was carried out using hybrid optimization of multiple energy resources software. The optimum hybrid system configuration was found to have a net present cost of $436,943 for 25 years with carbon dioxide emission amounting to 4,070 kg/year, compared to the traditional solar/diesel/battery microgrid which will require net present cost of $655,521 and emit 22,648 kg of carbon dioxide annually. Also, the cost of energy from this system is $0.151/kWh which is similar to the average grid tariff in the region. From the breakeven grid distance analysis, it was noted that the proposed solution is much more economical than grid extension for communities above a distance of 2.78 km to the grid.