Water-rich planets such as Earth are expected to become eventually uninhabitable, because liquid water turns unstable at the surface as temperatures increase with solar luminosity. Whether a large increase of atmospheric concentrations of greenhouse gases such as CO2 could also destroy the habitability of water-rich planets has remained unclear. Here we show with three-dimensional aqua-planet simulations that CO2-induced forcing as readily destabilizes the climate as does solar forcing. The climate instability is caused by a positive cloud feedback and leads to a new steady state with global-mean sea-surface temperatures above 330 K. The upper atmosphere is considerably moister in this warm state than in the reference climate, implying that the planet would be subject to substantial loss of water to space. For some elevated CO2 or solar forcings, we find both cold and warm equilibrium states, implying that the climate transition cannot be reversed by removing the additional forcing.