We formulate a version of the double copy for classical fields in curved spacetimes. We provide a correspondence between perturbative solutions to the bi-adjoint scalar equations and those of the Yang-Mills equations in position space. At the linear level, we show that there exists a map between these solutions for maximally symmetric spacetime backgrounds, that provides every Yang-Mills solution by the action of an appropriate differential operator on a bi-adjoint scalar solution. Given the existence of a linearized map, we show that it is possible to cast the solutions of the Yang-Mills equations at arbitrary perturbation order in terms of the corresponding bi-adjoint scalar solutions. This all-order map is reminiscent of the flat space BCJ double copy, and works for any curved spacetime where the perturbative expansion holds. We show that these results have the right flat space limit, and that the correspondence is agnostic to the choice of gauge.