In most of the experiments involving confinement of ground-state atoms by using of an optical-dipole trap (ODT) and Rydberg excitation of the atoms, one has to switch off ODT during Rydberg excitation and coherent manipulation because Rydberg atoms normally cannot be confined in a conventional ODT. This yields the extremely low repetition rate of the experimental sequence, and the spatial diffusion of the atoms during the period of switching off ODT greatly restricts coherence of the system. For a red-detuned ODT formed by a focused single-spatial-mode Gaussian laser beam with a typical 1/e 2 beam waist diameter of several ten micrometers, we performed the calculation of ODT's magic detuning for confinement of cesium ground state and Rydberg state with the same potential well. We used a highprecision sum-over-states method to calculate the dynamic polarizabilities of the 6S 1/2 ground state and highly-excited (nS 1/2 and nP 3/2 ) Rydberg state of cesium atoms, and identify corresponding magic detuning for optical wavelengths in the range of 850 − 2000 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 a 1879.43-nm single-frequency laser system with a wattlevel output power for setting up the magic ODT for 6S 1/2 ground-state and 84P 3/2 Rydberg-state cesium cold atoms. It is of great significance for implementing highfidelity quantum logic gates and other quantum information protocols involving highlyexcited Rydberg atoms in ODT.