High pollution levels resulting from the production of electricity from fossil fuels has led to the search for new energy alternatives, such as photovoltaic (PV) systems. In this work, a novel methodology for selecting PV components in order to generate the electricity demanded by different greenhouse systems based on equipment, hours of use and energy consumption was developed. For the selection of the PV components, catalogs with information on greenhouse equipment, sites with peak solar hours, PV modules, batteries, controllers and inverters were made, and algorithms for an economical selection were also developed. The methodology developed was applied in greenhouses covering a total area of 6,165 m2 at the “Tlapeaxco” experimental field belonging to the Universidad Autónoma Chapingo. A PV system, consisting of 16 PV modules with total output of 3.68 kWp, 2 80-A controllers, 12 1800-Ah batteries and a 7-kW inverter/charger, was selected and installed to generate and supply power to an irrigation system with a flow rate of 1.15±0.35 liters/s and a pressure of 0.28±0.02 MPa, composed of 2 2.2-kW pumps and a 1.1- kW motor for the agitator. Power system analysis showed a power factor (PF) of 0.8, so a 2 kVAR capacitor bank was installed to increase this factor to 0.94. The PV system was monitored and a daily energy production of 14.5±1.5 kWh in December, which ensures a sufficient power supply to the irrigation system, was estimated.