This study constructs an original mathematical model of a shipboard container crane and proposes a nonlinear controller for the complicated operation duties in which the viscoelasticity of seawater and the flexibility of handling cable are taken into account. By using two inputs, namely, the pulling force of the trolley and the torque of the hoist, the controller simultaneously drives six outputs, including trolley motion, cable length, container swing, axial container oscillation, ship roll, and ship heave.