Designing a Zero Energy Building (ZEB) requires an optimal choice of the materials of a building envelope. Different material properties and window areas could be selected to generate a set of possibilities of the design of a building, being the demand defined by its thermal characteristics. The energy demand of a building could be produced with renewable systems such as photovoltaic. Moreover, the HVAC (Heating, Ventilation, and Air Conditioning) systems could be selected considering the system cost. The present methodology focuses on finding a balance between investment and low energy consumption for a building, based on an integrated optimization method. Such methodology applies a Tabu search algorithm and a simplified model to select the passive design. Afterwards, active elements of the design, as photovoltaic systems, are selected. Therefore, the methodology faces the problem of estimating the annual energy demand and the life cycle cost. The goal is the design of a building with a large amount of energy generated by renewable energy, to have a ZEB, and in the worst case, a nearly Zero Energy Building (nZEB). This methodology reduces investment, reduces the energy demand and selects the best construction materials, renewable energy, and air conditioning system. The present paper analyzes a set of case studies considering different climatic zones in Spain. The results conclude that the methodology could help builders in the design stage, to find a new design that allows a ZEB with the optimal life cycle cost.The present paper explores a methodology to design a nZEB building, by choosing design elements in two steps (Figure 1). Firstly, the selection of passive elements, and secondly the selection of active elements with a system of photovoltaic panels to generate the energy required by such building. To achieve a ZEB (Zero Energy Building), the Building Integrated Photovoltaic (BIPV) systems used to generate electricity can play an important role [2]. A comprehensive review of the current state of the art in the area of the BIPV technology is shown in [3]. Moreover, some studies have verified the validity of BIPV systems for the challenge of Zero Energy Buildings [4]. Appl. Sci. 2018, 8, x FOR PEER REVIEW 2 of 14 remaining energy needs and renewable energies. Therefore, a nZEB will not only imply an optimized design and construction, but also the exploitation of energy resources in the most efficient way. The present paper explores a methodology to design a nZEB building, by choosing design elements in two steps (Figure 1). Firstly, the selection of passive elements, and secondly the selection of active elements with a system of photovoltaic panels to generate the energy required by such building. To achieve a ZEB (Zero Energy Building), the Building Integrated Photovoltaic (BIPV) systems used to generate electricity can play an important role [2]. A comprehensive review of the current state of the art in the area of the BIPV technology is shown in [3]. Moreover, some studies have verified the validity o...