As the world faces climate change induced increases of mean average temperature and severe weather events, the transition to renewable energy resources is ever important. The current rate of the transition is shown to be too slow, therefore, a more decentralized approach, for example, energy communities, might accelerate the phase-out of fossil fuels. Thus, the goal of this study is to realize the current state of energy communities, including the technology with the highest potential, and the barriers that are preventing a wider adoption, and to see how renewable technologies and peer-topeer energy trading models can be practically integrated to develop renewable energy communities in Latvia. This is done by placing an emphasis on renewable technologies that support these communities, such as 5th Generation District Heating and Cooling and Distributed Energy Resources, and how these innovations contribute to energy efficiency and carbon reduction. As part of this study, a dynamic multiple building model is developed, through which the integration of the renewable technologies and peerto-peer energy trading schemes are analysed. The study finds that the most significant barriers include regulatory gaps and uncertainties, financial constraints, technical and knowledge limitations, and social resistance, which continue to hinder the widespread integration of energy communities, specifically in Latvia. By examining these barriers and the technological advancements that support decentralized energy and analysing them through the dynamic model, this study highlights the potential and creates opportunities for energy communities to drive the European Union's and the Latvian green energy transition and reduce energy poverty, paving the way for a resilient and sustainable future.