Abstract Rod-like objects at high packing fractions can exhibit liquid crystalline ordering. By controlling how the rods align near a boundary, i.e. the anchoring, the defects of a liquid crystal can be selected and tuned. For smectic phases, the rods break rotational and translational symmetry by forming lamellae. Smectic defects thereby include both discontinuities in the rod orientational order (disclinations), as well as in the positional order (dislocations). In this work, we use experiments and simulations to uncover the geometrical conditions necessary for a boundary to set the anchoring of a confined, particle-resolved, smectic liquid crystal. We confine a colloidal smectic within elliptical wells of varying size and shape for a smooth variation of the boundary curvature. We find that the anchoring depends upon the local boundary curvature, with an anchoring transition observed at a critical radius of curvature approximately twice the rod length. Surprisingly, the critical radius of curvature for an anchoring transition holds across a wide range of rod lengths and packing fractions. The anchoring controls the defect structure. By analyzing topological charges and networks composed of maximum density (rod centers) and minimum density (rod ends), we quantify disclinations and dislocations formed with varying confinement geometry. Circular confinements, characterized by planar anchoring, promote disclinations, whereas elliptical confinements, featuring antipodal regions of homeotropic anchoring, promote long-range smectic order and dislocations. Our findings demonstrate how geometrical constraints can control the anchoring and defect structures of liquid crystals—a principle that is applicable from molecular to colloidal length scales.