Long ground-Rydberg coherence lifetime is interesting for implementing high-fidelity quantum logic gates, many-body physics, and other quantum information protocols. However, the potential formed by a conventional far-off-resonance red-detuned optical-dipole trap (ODT) is usually repulsive for Rydberg atoms, which will result in fast atom loss and low repetition rate of the experimental sequence. These issues can be addressed by a magic ODT. We performed the calculation of ODT’s magic detuning for confinement of ground-state and Rydberg-state cesium atoms with the same potential well. We used a sum-over-states method to calculate the dynamic polarizabilities of 6S1/2 ground state and highly-excited (nS1/2 and nP3/2) Rydberg state of cesium atoms, and identify corresponding magic detuning for optical wavelengths in the range of 850–1950 nm. We estimated the trapping lifetime of cesium Rydberg atoms confined in the magic ODT by including different dissipative mechanisms. Furthermore, we have experimentally realized an 1879.43 nm single-frequency laser system with a watt-level output power for setting up the magic ODT for 6S1/2 ground-state and 84P3/2 Rydberg-state cesium cold atoms.