In this work, the optimal management of the water grid belonging to a pilot agro-industrial district, based on greenhouse cultivation, is analyzed. Different water supply plants are considered in the district, some of them using renewable energies as power sources, i.e., a solar thermal desalination plant and a nanofiltration facility powered up by a photovoltaic field. Moreover, the trade with the water public utility network is also taken into account. As demanding agents, a greenhouse and an office building are contemplated. Due to the different water necessities, demand profiles, and the heterogeneous nature of the different plants considered as supplier agents, the management of the whole plant is not trivial. In this way, an algorithm based on the energy hubs approach, which takes into account economic terms and the optimal use of the available resources in its formulation, is proposed for the pilot district with a cropping area of 616 m2. Simulation results are provided in order to evidence the benefits of the proposed technique in two cases: Case 1 considers the flexible operation of the desalination plant, whereas in Case 2 the working conditions are forced to equal the plant’s maximum capacity (Case 2). A flexible operation results in a weekly improvement of 4.68% in profit, an optimized use of the desalination plant, and a reduction of the consumption of water from the public grid by 58.1%.