We present a potential energy surface (PES) for the cyclotrimethylene trinitramine (RDX) dimer obtained using symmetry-adapted perturbation theory based on the Kohn-Sham density functional theory (DFT) description of the monomers [SAPT(DFT)]. More than a thousand dimer configurations were computed using an augmented double-zeta-quality basis set supplemented by bond functions. The ab initio interaction energies were used to obtain a six-dimensional analytic fit of the interaction PES. The geometries and energies of the minima on the PES have been found from the fit. The decomposition of the PES into physical components provided by the SAPT(DFT) method has been analyzed. The PES was then used in molecular dynamics simulations of the RDX crystal. The predicted crystal density is in an excellent agreement with experiment.