We propose a quantum ranging protocol to determine the distance between an observer and a target at the line of sight in the curved spacetime of the Earth. Different from a quantum illumination scheme, here we employ a multiple quantum hypothesis testing to determine the existence and the location of the target at the same time. In the proposed protocol, the gravitational effect of the Earth influences the propagation of photons, and therefore has an observable impact on the performance of quantum ranging tasks. It is shown that the maximum potential advantages of the quantum ranging strategy in the curved spacetime has distinct superiority over its counterpart in the flat spacetime. This is because the effect of the gravitational red-shift and blue-shift on the entangled signal beam can cancel each other, while the thermal signal only suffers form the gravitational blue-shift effect. It is shown that increasing the number of transmitted modes can promote the maximum potential advantage of quantum ranging in the curved spacetime. However, the maximum potential advantage of quantum ranging in the curved spacetime can not been raised sharply by dividing the range into multiple slices.