We report detailed procedures for compression experiments on rocks and mineral aggregates within a multi-anvil deformation apparatus coupled with synchrotron X-radiation. Such experiments allow quantification of the stress distribution within samples, that ultimately sheds light on compaction processes in geomaterials.