Distributed energy resources have grown significantly in Canada and the world over the past decade, particularly in the agricultural sector. As P2P (peer-to-peer) energy trading plays a fundamental role in renewable energy uptake and system flexibility for the low-carbon energy transition, this paper provides an overview of this approach from a techno-economic standpoint for two greenhouses located in Leamington, Ontario. The real-time site solar irradiation, ambient temperature, and load demand over 8760 h have been utilized to drive the designs. In this investigation, two cases are assessed for pepper greenhouse: Case I: energy purchase from the grid and Case II: energy purchase from excess energy of neighbor which is cucumber-tomato greenhouse. The integration of 50 kW PV/1 kWh battery/35 kW converter achieves the feasibility criteria by recording net present cost (NPC) and cost of energy (COE), which are 29.6kand0.044/kWh, respectively