The Lagrangian and Hamiltonian for nonlinear gravity waves in a cylindrical basin are constructed in terms of the generalized co-ordinates of the free-surface displacement, {qn(t)} ≡ q, thereby reducing the continuum-mechanics problem to one in classical mechanics. This requires a preliminary description, in terms of q, of the fluid motion beneath the free surface, which kinematical boundary-value problem is solved through a variational formulation and the truncation and inversion of an infinite matrix. The results are applied to weakly coupled oscillations, using the time-averaged Lagrangian, and to resonantly coupled oscillations, using Poincaré's action—angle formulation. The general formulation provides for excitation through either horizontal or vertical translation of the basin and for dissipation. Detailed results are given for free and forced oscillations of two, resonantly coupled degrees of freedom.