The socioeconomic reality and the energy retrofit potential of the social housing neighbourhoods in Portugal are stimulating challenges to be addressed by research to pursue suitable energy efficient strategies to be integrated into these buildings. Therefore, this study explored a stochastic-based optimisation approach towards the integration of photovoltaic (PV) panels, considering different scenarios that combine the occupancy rate, the internal gains, the envelope refurbishment and the heating system efficiency. The optimisation approach has as its objective the minimisation of the life cycle cost of the photovoltaic system while using a limited space area on the rooftop for its installation. This study allowed concluding that the use of passive measures such as improving the thermal performance of the building envelope is essential to attain a lower optimal-sizing of a photovoltaic installation. The results reveal a decreasing trend in the PV optimal sizing, attaining a reduction up to 30% of the total number of PV panels installed on the sloped rooftop in several scenarios with 50% of occupancy rate. However, the impact can be greater when passive measures are coupled to more efficient heating systems, with higher COP, which result in a decrease up to 64% of the number of PV panels. Thus, the approach proposed is of paramount importance to aid in the decision-making process of design and sizing of photovoltaic installation, highlighting the practical application potential for social housing and a contribution for mitigation of the energy poverty of low-income families that live in these buildings.