A hydrogen fuel cell has many advantages, such as no pollution, high efficiency, low noise and continuous operation. Therefore, it has the potential to be widely applied in both the power propulsion and power supply of a ship. However, the consequent hydrogen safety and leakage issues have attracted much attention and become key issues that need to be resolved urgently. In this paper, based on the component transportation and chemical reaction modules in Fluent software, a ferry is selected as the research object, and a diffusion model of the high pressure hydrogen leakage in a cabin is established. The hydrogen concentration distributions at different leakage positions after the leakage occurs are obtained by making transient numerical calculations of the hydrogen leakage diffusion at the corresponding leakage positions in the cabin. At the same time, the effects of different ventilation conditions on the diffusion trend of hydrogen are analyzed. The simulation results have ascertained the optimal positions for hydrogen sensors and ventilations and it is hoped that these results can provide guidance for the design of a fuel cell ship that uses high pressure gaseous hydrogen.