The purpose of this work was to find the optimal configuration for an off-grid, renewable energy reverse osmosis desalination (RO) system. The objective was to find the lowest levelized cost of energy (LCOE), with power reliability as the constraint. A genetic algorithm was used to solve the nonlinear integer programming problem. A site with brackish groundwater in Arizona, USA, was selected. The capacity of the RO system was 11.36 m(3)/d (3,000 gal/d), requiring a constant power consumption of 2.366 kW. The results showed that the optimal configuration was a hybrid photovoltaic/wind/diesel/battery system with LCOE 0.527 USD/kWh and the corresponding levelized cost of water 3.585 USD/m(3), which were about half of the 7.9 USD/m(3) currently paid by residents in the area. Sensitivity analyses showed that: (a) the LCOE was fairly insensitive to photovoltaic panel tilt angle over a range; (b) the optimal tilt angle for the hybrid system must be found in the context of the performance of the entire system; (c) the "more hybrid" the renewable energy system, the lower the LCOE; (d) the LCOE value was monotone increasing as diesel price or discount rate increasing, respectively, and different diesel price or discount rate could bring different optimal configurations with diesel generators.