  We use the LHCb data on the forward production of $D$ mesons at 7, 13 and 5
TeV to make a direct determination of the gluon distribution, $xg$, at NLO in
the $10^{-5} \lesssim x \lesssim 10^{-4}$ region. We first use a simple
parametrization of the gluon density in each of the four transverse momentum
intervals of the detected $D$ mesons. Second, we use a double log
parametrization to make a combined fit to all the LHCb $D$ meson data. The
values found for $xg$ in the above $x$ domain are of the similar magnitude (or
a bit larger) than the central values of extrapolations of the gluons obtained
by the global PDF analyses into this small $x$ region. However, in contrast, we
find $xg$ has a weak dependence on $x$.
