Abstract Recently, we constructed the specific solution to the second-order cosmological perturbation theory, around any Friedmann–Lema\^itre–Robertson–Walker (FLRW) background filled with dust matter and a positive cosmological constant. In this paper, we use the {\it Cosmicflows-4} (CF4) sample of galaxies from the Extragalactic Distance Database to constrain this metric tensor. We obtain an approximation to the local matter distribution and geometry. We numerically solve for null geodesics for randomly distributed mock sources and compare this model with the Lema\^itre-Hubble constant inferred from the observations under the assumption of perfect isotropy and homogeneity. We conclude on effects of realistic inhomogeneities on the luminosity distance in the context of the Hubble tension and discuss limitations of our approach.