In recent decades the share of GHG (Green House Gases) such as carbon dioxide (CO2), and local pollutants as carbon monoxide (CO), nitrogen oxides (NOx), and sulphur oxides (SOx) produced by shipping has significantly increased. In the case of CO2, the IMO (International Maritime Organization) has estimated that emissions will increase by a range of 90-130% in 2050 as compared to 2008. In this scope, penetration of new technologies such as Battery Energy Storage Systems (BES) can reduce the share of emissions, giving more flexibility to the ship’s system. In this work, an optimization algorithm based on Mixed-Integer-Linear-Programming (MILP) approach has been developed to define the best environmentally sustainable technology mix to be installed on board. The model is based on Demand-Driven optimization, where the main goal is to satisfy electrical and thermal energy demand, which is achieved by using linear constraints. The objective function is defined to minimize on-board energy production costs considering the CAPEX and OPEX of each technology, choosing the best technology mix and giving the schedule of working conditions for each installed technology. The non linearity of the components’ characteristic curves is tackled through piecewise-linearization approach. In this way, the algorithm can optimize the real operating conditions for technologies with higher accuracy of partial load conditions. The case study is based on real energy demand profiles of a cruise ship sailing between Stockholm and the island of Åland, in the Baltic Sea.