A hydrodynamic theory of premixed flame propagation within closed vessels is developed assuming the flame is much thinner than all other fluid dynamic lengths. In this limit, the flame is confined to a surface separating the unburned mixture from burned combustion products, and propagates at a speed determined from the analysis of its internal structure. Unlike freely propagating flames that propagate under nearly isobaric conditions, combustion in a closed vessel results in continuous increases in pressure, burning rate and flame temperature, and a progressive decrease in flame thickness. The flame speed is shown to depend on the voluminal stretch rate, which measures the deformation of a volume element of the flame zone, and on the rate of pressure rise. Both effects are modulated by pressure-dependent Markstein numbers that depend on heat release and mixture properties while capturing the effects of temperature-dependent transport and stoichiometry. The model applies to flames of arbitrary shape propagating in general flows, laminar or turbulent, within vessels of general configurations. The main limitation of hydrodynamic flame theories is the assumption that variations inside the flame zone due to chemistry or turbulence, which could potentially alter its internal structure, are physically unresolved. Nonetheless, the theory, deduced from physical first principles, identifies the various mechanisms involved in the combustion process as demonstrated in detailed discussions of planar flames propagating in rectangular channels and spherically expanding flames in spherical vessels. It also enables the construction of instructive models to numerically simulate the evolution of multi-dimensional and corrugated flames under confinement.