The stability of axisymmetric vortices to inertial perturbations is investigated by means of linear stability analysis, taking into account stratification, vertical eddy viscosity, as well as finite depth of the flow. We consider different types of circular barotropic vortices in a linearly stratified shallow layer confined with rigid lids. For the simplest case of the Rankine vortex we develop an asymptotic analytic dispersion relation and a marginal stability criterion, which compares well with numerical results. This is a further generalization to the well-known generalized Rayleigh criterion, which is only valid for non-dissipative and non-stratified eddies. Unlike the Rayleigh criterion, it predicts that intense anticyclones may be stable even with a core region of negative absolute vorticity, and that the dissipation and stratification work together to stabilize the flow. Numerical analysis reveals that the stability diagrams for various types of vortices are almost identical in the Rossby, Burger and Ekman parameter space. This allows extension of our analytical solutions for the Rankine vortex to a wide variety of vortices. Furthermore, we show that a more suitable parameter for the intensity of the vortex is the vortex Rossby number, while for the inviscid case it is the local normalized vorticity. These predictions are in agreement with laboratory experiments presented in part 2 (J. Fluid Mech., vol. 732, 2013, pp. 485–509).