In this article the solar energy is utilized to generate needed steam for a power generation cycle which in turn provides the required power of a RO system. Optimization was carried out on two levels. First, Economizer, Evaporator, Super heater in power generation cycle as well as the type of membrane, PV numbers and series were optimized. In addition, the optimum design of a solar field for the system was carried out and the collector specifications, number of branches, and flow rate were designed. Based on the first level, optimization was designed to reduce costs and increase the permeate water production and reduction in costs and pressure drop of the solar filed. Preheating of the RO feed water had different effects on the production of fresh water at various concentrations. For feed water with constant flow rate and concentration of 45 000 ppm, the maximum rate of permeate flow was obtained at 26°C, while for concentration of 35 000 ppm, the maximum permeate flow rate was achieved at 33°C. By using 5 parallel elements SW30XLE‐400 for RO system, in the optimized condition, permeate flow rate and recovery were 9494.19 (m3/day) and 59.5%, respectively. In this condition, the unit production cost of water was 0.6046 ($/m3).