A system of charged bosons at finite temperature and chemical potential is studied in a general-relativistic framework. We assume that the boson fields interact only gravitationally. At sufficiently low temperature the system exists in two phases: the gas and the condensate. By studying the condensation process numerically we determine the critical temperature $T_c$ at which the condensate emerges. As the temperature decreases, the system eventually settles down in the ground state of a cold boson star.