The high-precision X-ray diffraction setup for work with diamond anvil cells (DACs) in interaction chamber 2 (IC2) of the High Energy Density instrument of the European X-ray Free-Electron Laser is described. This includes beamline optics, sample positioning and detector systems located in the multipurpose vacuum chamber. Concepts for pump–probe X-ray diffraction experiments in the DAC are described and their implementation demonstrated during the First User Community Assisted Commissioning experiment. X-ray heating and diffraction of Bi under pressure, obtained using 20 fs X-ray pulses at 17.8 keV and 2.2 MHz repetition, is illustrated through splitting of diffraction peaks, and interpreted employing finite element modeling of the sample chamber in the DAC.