Warm or massive gas giant planets, brown dwarfs, and debris disks around nearby stars are now routinely observed by dedicated high-contrast imaging instruments on large, ground-based observatories. These facilities include extreme adaptive optics (ExAO) and state-of-the-art coronagraphy to achieve unprecedented sensitivities for exoplanet detection and spectral characterization. However, differential aberrations between the ExAO sensing path and the science path represent a critical limitation for the detection of giant planets with a contrast lower than a few $10^{-6}$ at very small separations (<0.3as) from their host star. In our previous work, we proposed a wavefront sensor based on Zernike phase contrast methods to circumvent this issue and measure these quasi-static aberrations at a nanometric level. We present the design, manufacturing and testing of ZELDA, a prototype that was installed on VLT/SPHERE during its reintegration in Chile. Using the internal light source of the instrument, we performed measurements in the presence of Zernike or Fourier modes introduced with the deformable mirror. Our experimental and simulation results are consistent, confirming the ability of our sensor to measure small aberrations (<50 nm rms) with nanometric accuracy. We then corrected the long-lived non-common path aberrations in SPHERE based on ZELDA measurements. We estimated a contrast gain of 10 in the coronagraphic image at 0.2as, reaching the raw contrast limit set by the coronagraph in the instrument. The simplicity of the design and its phase reconstruction algorithm makes ZELDA an excellent candidate for the on-line measurements of quasi-static aberrations during the observations. The implementation of a ZELDA-based sensing path on the current and future facilities (ELTs, future space missions) could ease the observation of the cold gaseous or massive rocky planets around nearby stars.