In this paper we study a partially overdetermined mixed boundary value problem for domains Ω contained in an unbounded set C. We introduce the notion of Cheeger set relative to C and show that if a domain Ω ⊂ C admits a solution of the overdetermined problem, then it coincides with its relative Cheeger set. We also study the related problem of characterizing constant mean curvature surfaces Γ inside C. In the case when C is a cylinder we obtain further results whenever the relative boundary of Ω or the surface Γ is a graph on the base of the cylinder.