Access to clean and affordable energy in rural African regions can contribute greatly to social development. Hence, this article proposes the design, simulation, and optimization of a stand-alone photovoltaic system (SAPV) to provide non-polluting electrical energy based on a renewable source for a rural house located in Tazouta, Morocco. Real monthly electrical demands and hourly climatic conditions were utilized. An initial design process indicated that, with a 1080 Wp total capacity of PV modules and 670 Ah of battery storage, the proposed SAPV system was able to meet a considerable part of the dwelling load with an average solar fraction of about 79.1%. The rest of the energy demand was ensured by a diesel generator (DG). Also, a life cycle analysis of the PV system revealed that the life cycle cost is 10,195.56 USD and the unit electricity cost is 0.57 USD/kWh for an initial investment of 4858.68 USD. Thereafter, an optimum design based on Homer Pro software was carried out indicating that lower PV capacity can decrease the unit energy cost to 0.356 USD/kWh while reducing the solar fraction to 54.9%.