The origin of the planets atmosphere is a profound question of comparative planetology. There are two competing models, i.e. outgassing from the interior or late delivery from comets or volatiles-rich asteroids after most of the planet has been formed, of which the former is currently preferred. Meteorite compositions as well as radial mixing during accretion derived from accretion models suggest that the building blocks of the terrestrial planets contained some volatiles. Processes like dehydration by hydrous melting, oxidation, impact devolatilization, and in particular degassing during magma ocean solidification will then lead to a significant volatile loss of the interior and to the formation of a dense atmosphere during the early stages of planetary evolution. These processes are also responsible for the oxidation state of this early atmosphere, i.e. whether it was more reduced or oxidized. Although this early volatile loss was very efficient, the interior probably retained some water. This was distributed in the subsequent evolution between interior and atmosphere, as well as on the surface as liquid water in case of favorable temperature and pressure conditions. The main processes responsible for the water distribution are volcanic outgassing driven by partial melting of the silicate mantle and formation of the crust and recycling of water-rich crustal material. Here, an important difference between the terrestrial planets is the tectonic style prevailing on the planet. For the Earth with its plate tectonics, recycling of water is very efficient and can even balance the outgassing. For terrestrial planets in the stagnant lid regime of mantle convection such as Mars, the exchange of water between the interior and the surface/atmosphere is mainly in one direction and results in a continuous depletion of the interior. In this talk, I will briefly review our current knowledge on these interactions between interior and atmosphere and on the problem we are facing to better understand the influence of the interior on the habitability of a planet.