In response to technological advances, environmental concerns, and the depletion of conventional energy sources, the world is increasingly focusing on renewable energy sources (RES) as a means of generating electricity in a more sustainable and environmentally friendly manner. Türkiye, with its advantageous geographical location, long hours of sunshine, and favourable climatic conditions, has a high potential for the use of solar energy. The objective of this study was to identify an energy system that minimizes investment costs while optimizing the levelized cost of energy (LCOE) and minimizing greenhouse-gas (GHG) and carbon dioxide emissions. To achieve this, the study used the concept of nanogrids (NGs) and carried out different evaluations for electric vehicle charging stations (EVCS) at different energy levels connected to the grid. The research focused on classic apartment buildings and multistory condominium-style buildings in Istanbul, Türkiye. Using HOMER Grid 1.11.1 version software, the study identified two optimal configurations: a PV–GRID system with 7 kW photovoltaic capacity and a PV–WT–GRID system with 90 kW PV capacity and 6 kW wind-turbine capacity. These configurations had a significantly lower LCOE compared to the cost of electricity from the conventional grid. When examining the sensitivity to economic factors, it was observed that the net present cost (NPC) and LCOE values fluctuated with electricity prices, inflation rates, and equipment costs. In particular, the two optimal configurations did not include a battery energy-storage system (BESS) due to the low energy demand in the PV–GRID system and the efficiency of the wind turbines in the PV–WT–GRID system. This highlights the need to tailor energy solutions to specific consumption patterns and resource types. In conclusion, the adoption of PV–GRID and PV–WT–GRID systems in Istanbul’s urban buildings demonstrates economic viability and environmental benefits, highlighting the importance of renewable energy sources, particularly solar PV, in mitigating energy-related environmental challenges, such as reducing CO2 emissions and reducing dependence on conventional grid electricity.