Within the framework of Lagrangian mechanics, the conservativeness of the hydrostatic forces acting on a floating rigid body is proved. The representation of the associated hydrostatic potential is explicitly worked out. The invariance of the resulting Lagrangian with respect surge, sway and yaw motions is used in connection with the Routh procedure in order to convert the original dynamical problem into a reduced one, in three independent variables. This allows to put on rational grounds the study of hydrostatic equilibrium, introducing the concept of pseudo--stability, meant as stability with respect to the reduced problem. The small oscillations of the system around a pseudo-stable equilibrium configuration are discussed.