Maturing distributed generation (DG) technologies have promoted interest in alternative sources of energy for commercial building applications due to their potential to supply on-site heat and power at a lower cost and emissions rate compared to centralized generation. Accordingly, we present an optimization model that determines the mix, capacity, and operational schedule of DG technologies that minimize economic and environmental costs subject to the heat and power demands of a building and to the performance characteristics of the technologies. The technologies available to design the system include lead-acid batteries, photovoltaic cells, solid oxide fuel cells, heat exchangers, and a hot water storage tank. Modeling the acquisition and operation of discrete technologies requires integer restrictions, and modeling the variable electric efficiency of the fuel cells and the variable temperature of the tank water introduces nonlinear equality constraints. Thus, our optimization model is a nonconvex, mixed-integer nonlinear programming (MINLP) problem. Given the difficulties associated with solving large, nonconvex MINLPs to global optimality, we present convex underestimation and linearization techniques to bound and solve the problem. The solutions provided by our techniques are close to those provided by existing MINLP solvers for small problem instances. However, our methodology offers the possibility to solve large problem instances that exceed the capacity of existing solvers and that are critical to the real-world application of the model.