The Facility for Antiproton and Ion Research (FAIR), an international accelerator centre, is under construction in Darmstadt, Germany. FAIR will provide high-intensity primary beams of protons and heavy-ions, and intense secondary beams of antiprotons and of rare short-lived isotopes. These beams, together with a variety of modern experimental setups, will allow to perform a unique research program on nuclear astrophysics, including the exploration of the nucleosynthesis in the universe, and the exploration of QCD matter at high baryon densities, in order to shed light on the properties of neutron stars, and the dynamics of neutron star mergers. The Compressed Baryonic Matter (CBM) experiment at FAIR will investigate collisions between heavy nuclei, and measure various diagnostic probes, which are sensitive to the high-density equation-of-state (EOS), and to the microscopic degrees-of-freedom of high-density matter. The CBM physics program will be discussed.