We perform a Bayesian analysis of pulsar-timing residuals from the NANOGrav pulsar-timing array to search for a specific form of stochastic narrow-band signal produced by oscillating gravitational potential ( Gravitational Potential Background ) in the galactic halo . Such oscillations arise in models of warm dark matter composed of an ultralight massive scalar field ( m \sim 10 ^ { -23 } eV ) , recently considered by Khmelnitsky and Rubakov [ J. Cosmol . Astropart . Phys . 2 ( 2014 ) 019 ] . In the monochromatic approximation , the stringent upper limit ( 95 % C.L . ) on the variable gravitational potential amplitude is found to be \Psi _ { c } < 1.14 \times 10 ^ { -15 } , corresponding to the characteristic strain h _ { c } = 2 \sqrt { 3 } \Psi _ { c } < 4 \times 10 ^ { -15 } at f = 1.75 \times 10 ^ { -8 } \mathrm { Hz } . In the narrow-band approximation , the upper limit of this background energy density is \Omega _ { \mathrm { GPB } } < 1.27 \times 10 ^ { -9 } at f = 6.2 \times 10 ^ { -9 } \mathrm { Hz } . These limits are an order of magnitude higher than the expected signal amplitude . The applied analysis of the pulsar-timing residuals can be used to search for any narrow-band stochastic signals with different correlation properties . As a by-product , parameters of the red noise present in four NANOGrav pulsars ( J1713+0747 , J2145-0750 , B1855+09 , and J1744-1134 ) have been evaluated .