In the paper presented current energy situation in Ukraine after last attacks, issues and ways of decisions are analyzed. One of the approaches of increasing energy safety in Ukraine is decentralization of energy sources. Digitization, Decarbonization, Decentralization energy sector are main goals of rebuild plan Ukraine, and response goal of sustainable development EU. Main benefits of decentralization of energy sources are highlighted. Creation of energy community with distributed renewable energy sources is way of adopt to current situation in deficit centralized power supply. Digitization energy community realized through Digital Twin. Digital Twin concept helps design and control, modify during usage and develop recommendations for operation PV system. For optimization process of development energy community need take into account technical, meteorological, social, financial and ecology factors. For solving complex optimization task proposed use criterion programming method. Theory sensitivity is applied for optimization control task energy community. Model shelter-city energy community was developed and described.