Motivated by practical engineering applications, the present paper examines the mechanical response of thin-walled cylinders surrounded by a rigid or deformable medium, subjected to uniform external pressure. Emphasis is given to structural stability in terms of buckling, postbuckling, and imperfection sensitivity. The present investigation is computational and employs a two-dimensional model, where the cylinder and the surrounding medium are simulated with nonlinear finite elements. The behavior of cylinders made of elastic material is examined first, and a successful comparison of the numerical results is conducted with available closed-form analytical solutions for rigidly confined cylinders. Subsequently, the response of confined thin-walled steel cylinders is examined. The numerical results show an unstable postbuckling response beyond the point of maximum pressure and indicate severe imperfection sensitivity on the value of the maximum pressure. A good comparison with limited available test data is also shown. Furthermore, the effects of the deformability of the surrounding medium are examined. In particular, soil embedment conditions are examined, with direct reference to the case of buried thin-walled steel pipelines. Finally, based on the numerical results, a comparison is attempted between the present buckling problem and the problem of “shrink buckling.” The differences between those two problems of confined cylinder buckling are pinpointed, emphasizing the issue of imperfection sensitivity.