We present a Monte Carlo simulation study of chiral nematic liquid crystals confined in torus-shaped and cylindrical cavities. For an achiral nematic with planar degenerate anchoring confined to a toroidal or cylindrical cavity, the ground state is defect free, with an untwisted director field. As chirality is introduced, the ground state remains defect free but the director field becomes twisted within the cavity. For homeotropic anchoring, the ground state for an achiral nematic within a toroidal cavity consists of two disclination rings, one large and one small, that follow the major circumference of the torus. As chirality is introduced and increased, this ground state becomes unstable with respect to twisted configurations. The closed nature of the toroidal cavity requires that only a half integer number of twists can be formed and this leads to the ground state being either a single disclination line that encircles the torus twice or a pair of intertwined disclination rings forming stable, knotted defect structures.