This thesis aims to design a community energy system (CES) with controls optimizing for cost savings. This research treats electrical and thermal domains as an integrated system to find a global minimum cost of a community energy system. A proposed methodology to quantify an electric grid user's greenhouse gas (GHG) emission is presented and then demonstrated with a case study. Furthermore, an optimization methodology is presented to lower an electrical grid user's electrical bill through the implementation of a battery energy storage system. This cost optimization showcases with a case study demonstrating that optimizing to lower costs has an added benefit of lowering GHG emissions and removing peak demand capacity from the grid. This optimization methodology is than expanded to lowering a CES's electrical and gas bill by way of controlling an on-site generator, a battery energy storage system and a thermal energy storage system.