The future Facility for Antiproton and Ion Research (FAIR) is an accelerator-based international center for fundamental and applied research, which presently is under construction in Darmstadt, Germany. An important part of the program is devoted to questions related to astrophysics, including the origin of elements in the universe and the properties of strongly interacting matter under extreme conditions, which are relevant for our understanding of the structure of neutron stars and the dynamics of supernova explosions and neutron star mergers. The Compressed Baryonic Matter (CBM) experiment at FAIR is designed to measure promising observables in high-energy heavy-ion collisions, which are expected to be sensitive to the high-density equation-of-state (EOS) of nuclear matter and to new phases of QCD matter at high densities. The CBM physics program, the relevant observables and the experimental setup will be discussed.