The purpose of this work is to study the optimization of an hybrid system of electricity production (solar-diesel with storage) of Biret (Mauritania) using the Hybrid Optimization Model for Electric Renewables (HOMER) software. Indeed, it shows that the context and behavior of the chosen system is optimal. HOMER is used to present simulations in the most economical way. It is important to note that the application of HOMER (using meteorological data obtained on the site) analyses the profitability or otherwise of the technologies used in Biret and proposes a hybrid system, taking into account the economic aspects of the project. From this perspective, simulations can be carried out to obtain the best configuration of the hybrid system used for electricity production in Biret. These simulations show the economic optimization of an electricity production using a hybrid system. To this end, a pilot installation, based on this concept, was carried out in Biret. It consists of a 61.44 kw solar field and a 40 kW generating set with 2950 Ah storage system. Optimization of the pilot unit was first studied using the solar-diesel system and secondly by operating the diesel coupled to the storage system. This led to the conclusion that a slight increase in sunshine will result in a decrease in the price of Kwh. On the other hand, that any increase in the price of diesel, while maintaining the constant sunshine will lead to an increase in the price of Kwh. This makes it possible to position this paper in terms of optimal management of the hybrid electricity production system, as a first step of popularizing the photovoltaic systems in the countries of Sahel.