Distributed Energy Sources (DERs) have been the focus of the modern power industry as they are proven to be a more efficient and reliable source of energy supply. Renewable Energy Sources (RES) and other DERs are integrated into the grid at the distribution level to set up a Microgrid (MG). The main objective of this thesis was to develop a concept design of NTNU Gløshaugen campus as a microgrid; implement energy management system with PVs and batteries to achieve peak-shaving; and improve the stability of the microgrid during load variations and after fault clearance. Data from the existing grid network was used to model the campus on ETAP-16. Time-based AC/DC Load flow and transient stability simulations were performed to analyze the system behaviour under different conditions. The burden on the utility grid was reduced significantly after the integration of PVs and batteries during peak hours. The adequate operation of batteries resulted in achieving a flat utility output power curve when the demand was high. The stability of the system was improved with the generator’s exciter AVR control for the worst-case scenario. As a result, the bus and generator parameters were reaching their steady-state values within a reasonable time.