Neutron reflectometry was used to study the assembly of magnetic nanoparticles in a water-based ferrofluid close to a silicon surface. Under three conditions, static, under shear and with a magnetic field, the depth profile is extracted. The particles have an average diameter of 11 nm and a volume density of 5% in a D2O–H2O mixture. They are surrounded by a 4 nm thick bilayer of carboxylic acid for steric repulsion. The reflectivity data were fitted to a model using a least square routine based on the Parratt formalism. From the scattering length density depth profiles the following behavior is concluded: the fits indicate that excess carboxylic acid covers the silicon surface and almost eliminates the water in the densely packed wetting layer that forms close to the silicon surface. Under constant shear the wetting layer persists but a depletion layer forms between the wetting layer and the moving ferrofluid. Once the flow is stopped, the wetting layer becomes more pronounced with dense packing and is accompanied by a looser packed second layer. In the case of an applied magnetic field the prolate particles experience a torque and align with their long axes along the silicon surface which leads to a higher particle density.