Greenhouses require energy in order to provide a proper environment for crop production. Utilizing solar energy in solar greenhouses is a sustainable solution to face this problem. In this study, a solar greenhouse concept is considered, and a dynamic thermal model is developed to predict the inside air temperature. The model is integrated into an optimization procedure to find the optimal greenhouse design that has the best thermal performance by adjustin. Greenhouses require energy in order to provide a proper environment for crop production. Utilizing solar energy in solar greenhouses is a sustainable solution to face this problem. In this study, a solar greenhouse concept is considered, and a dynamic thermal model is developed to predict the inside air temperature. The model is integrated into an optimization procedure to find the optimal greenhouse design that has the best thermal performance by adjusting its structural parameters. This optimization procedure provides a tool to find the optimal solar greenhouse design for each climate condition and predict its performance. For instance, for the case study of Tehran (Iran), the optimal solar greenhouse works 85% of times passively in a year. Besides, this tool is flexible to change the objective function, from year-round performance to seasonal or cultivation period performances. For example, the optimal solar greenhouse for the case study has completely different structural parameters comparing the optimal seasonal solar greenhouse. This is also a decision-making tool to decide the cultivation type based on best energy performance. For the case study, the results indicate that the cultivation of cucumber, melon, and watermelon is the priority comparing other usual greenhouse products.••••Optimization of solar greenhouses structural parameters for each climate condition.••Prediction of solar greenhouse thermal performance.••Planning the cultivation regarding energy demand.••Decision making of the type of crop based on energy demand.Solar greenhouseSolar thermalHeat transfer modelOptimizationSolar energyEnergy modelingThree of seventeen goals of the 2030 United Nations sustainable development involve access energy, water, and food and providing security of them. Growing population, urbanization, dietary change, and other consequences of economic development are increasing the demand for energy, food, and water by 30–50% in the next two decades. These are putting pressure on the supply resources and causing environmental damages [2,3]. Energy, water and food are interdependent issues and any strategy focusing on one part of energy-water-food nexus without considering interconnections risks severe unintended consequences.Greenhouse technology is an effective strategy for intensification of food system to meet the increasing demand for food while water, energy, and land resources are scarce [7,8]. This technology is the junction of energy-water-food nexus by increasing the production yield up to ten times more and decreasing the water consumption up to twelve times less than conventional cultivation. However, greenhouse energy consumption can be up to one hundred times more. Huge energy consumption in greenhouses has been pointed out in many studied for different regions like Netherland, Spain, Italy, Turkey and etc. Greenhouses mostly rely on fossil fuels which will lead them to play a significant role in high primary energy consumption, pollution, investment and operationa. The first step of this study was to consider a solar greenhouse concept. The structure of greenhouse must have a shape that maximizes collecting solar energy and minimizes heat loss. One-sided curved shape greenhouse facing to the south is satisfying since it maximizes exposure to light and solar energy (Fig. 2). The northern side of the structure has the least contribution in solar energy gain while it causes heat loss, so it is a perfect place to put the heat storage system. Heat storage is a thickly layered wall consist of one layer of heat storing material, then a layer of insulation material and a third layer that complete the insulation. A movable thermal insulation blanket covers the transparent cover during the night to prevent the heat loss. Ventilation is done by fans in the eastern and western walls.As it is shown in Fig. 3, solar radiation transmits into the greenhouse during the day. The curved shape roof collects solar radiation from sunrise to sunset efficiently. Part of entered solar energy is absorbed by heat storage wall and soil of the ground and increases their temperatures (absorbed solar radiation is converted to sensible heat). Temperature difference as the driving force causes heat transfer between the greenhouse surfaces and inside air via convection. Conduction heat transfer happens into the thermal storage wall to store heat in the day and keep the greenhouse warm at night. Part of absorbed solar energ.