Vapor bubbles are formed in liquids by two mechanisms: evaporation (temperature above the boiling threshold) and cavitation (pressure below the vapor pressure). The liquid resists in these metastable (overheating and tensile, respectively) states for a long time since bubble nucleation is an activated process that needs to surmount the free energy barrier separating the liquid and the vapor states. The bubble nucleation rate is difficult to assess and, typically, only for extremely small systems treated at an atomistic level of detail. In this work a powerful approach, based on a continuum diffuse interface modeling of the two-phase fluid embedded with thermal fluctuations (fluctuating hydrodynamics), is exploited to study the nucleation process in homogeneous conditions, evaluating the bubble nucleation rates and following the long-term dynamics of the metastable system, up to the bubble coalescence and expansion stages. In comparison with more classical approaches, this methodology allows us on the one hand to deal with much larger systems observed for a much longer time than possible with even the most advanced atomistic models. On the other, it extends continuum formulations to thermally activated processes, impossible to deal with in a purely determinist setting.