This research proposes a smart microgrid installation and operation for an island by introducing ship's generators as a backup generator. On a small island, it is challenging to run big loads such as tower cranes and big motors, which are very necessary for the island's industrial development. Besides, photovoltaic (PV) and wind turbine generator (WG) output power output depends on weather conditions. So, the uncertainty of PV generations is a common drawback that is very difficult to tackle. Sometimes, due to a huge drop in renewable generators, the backup generators need to run. Even the backup generator ensures a certain time of resilience for a microgrid during the time of any unexpected moment. The installation of a backup generator involves a lot of costs. Also, to run a fossil fuel-based generator needs fuel transportation costs. Therefore, the proposed scheme introduces the ship's generators as backup generators to reduce a large number of installation costs. Every day, there are some passenger ships and fishing ships available at their seaport on the island. They have a high-power generator, which might be available for giving power to the grid during the grid shortage. The proposed microgrid consists of PV, WG, smart house (SH), battery energy storage system (BESS), thermal generator, and backup ship's generators. Finally, the MATLAB INTLINGPROG optimization toolbox is utilized to optimally minimize the operation cost of the microgrid.