Renewable energy sources are gradually being recognized as important options in supply side planning for microgrids. This paper focuses on the optimal design, planning, sizing and operation of a hybrid, renewable energy based microgrid with the goal of minimizing the lifecycle cost, while taking into account environmental emissions. Four different cases including a diesel-only, a fully renewable-based, a diesel-renewable mixed, and an external grid-connected microgrid configurations are designed, to compare and evaluate their economics, operational performance and environmental emissions. Analysis is also carried out to determine the break-even economics for a grid-connected microgrid. The well-known energy modeling software for hybrid renewable energy systems, HOMER is used in the studies reported in this paper.