The Hubble constant H0, the current expansion rate of the universe, is one of the most important parameters in cosmology. The cosmic expansion regulates the mutually approaching motion of a pair of celestial objects due to their gravity. Therefore, the mean pairwise peculiar velocity of celestial objects, which quantifies their relative motion, is sensitive to both H0 and the dimensionless total matter density Ωm. Based on this, using the Cosmicflows-4 data, we measured H0 for the first time via the galaxy pairwise velocity in the nonlinear and quasi-linear range. Our results yield H0=75.5±1.4 km s−1 Mpc−1 and Ωm=0.311+0.029−0.028 . The uncertainties of H0 and Ωm can be improved to around 0.6% and 2%, respectively, if the statistical errors become negligible in the future.