This article presents a study of optimal control strategies for an energy storage system connected to a network of electrified Rubber Tyre Gantry (RTG) cranes. The study aims to design optimal control strategies for the power flows associated with the energy storage device, considering the highly volatile nature of RTG crane demand and difficulties in prediction. Deterministic optimal energy management controller and a Model Predictive Controller (MPC) are proposed as potentially suitable approaches to minimise the electric energy costs associated with the real-time electricity price and maximise the peak demand reduction, under given energy storage system parameters and network specifications. A specific case study is presented in to test the proposed optimal strategies and compares them to a set-point controller. The proposed models used in the study are validated using data collected from an instrumented RTG crane at the Port of Felixstowe, UK and are compared to a standard set-point controller. The results of the proposed control strategies show a significant reduction in the potential electricity costs and peak power demand from the RTG cranes.