Computing uniformization maps for surfaces has been a challenging problem and has many practical applications. In this paper, we provide a theoretically rigorous algorithm to compute such maps via combinatorial Calabi flow for vertex scaling of polyhedral metrics on surfaces, which is an analogue of the combinatorial Yamabe flow introduced by Luo (Commun Contemp Math 6(5):765–780, 2004). To handle the singularies along the combinatorial Calabi flow, we do surgery on the flow by flipping. Using the discrete conformal theory established in Gu et al. (J Differ Geom 109(3):431–466, 2018; J Differ Geom 109(2):223–256, 2018), we prove that for any initial Euclidean or hyperbolic polyhedral metric on a closed surface, the combinatorial Calabi flow with surgery exists for all time and converges exponentially fast after finite number of surgeries. The convergence is independent of the combinatorial structure of the initial triangulation on the surface.