In this study, we have presented an optimal microgrid design that ensures the uninterrupted energy supply to Mirpur University of Engineering and Technology (MUST), Azad Jammu and Kashmir AJK, Pakistan at the cheapest price by using reliable energy resources. The availability of energy resources, environmental viability, and economic feasibility are the key parameters of design. The available resources for the MUST site include the National grid, Solar photovoltaic (SPV), Battery bank, and Diesel generator. The data of electrical load, solar illumination, atmospheric temperature at the university, diesel fuel cost, SPV module lifetime, SPV degradation factor, SPV efficiency, SPV cost, battery cost, battery life, national grid energy price, load shedding and toxic emissions have been considered valuables in designing the hybrid micro-grid. The difference in net present cost (NPC) of the optimal design and the worst design is calculated by considering the above parameters. The proposed optimal microgrid design supplies energy to the load using SPV, Diesel generator, and battery bank with NPC of $250,546 and the renewable fraction of 99%. Whereas the worst design includes the Diesel generator and battery bank as energy supplying sources with the NPC of $2.14 M and a renewable fraction of 0%. Simulations performed using HOMER Pro software (HOMER Energy, HOMER Pro-3.11, Boulder, CO, USA) proved that after considering all the data and requirements mentioned above, out of 979 feasible designs, the proposed hybrid microgrid design is best suitable for MUST.