Mg–Ni multilayers and Ni-rich Mg thin films were deposited by electron gun and pulsed laser deposition, respectively. Samples were submitted to thermal treatment in deuterium or hydrogen atmosphere at 423K and ∼105 Pa pressure to promote the metal to hydride phase transition. The H chemical bonding in the multilayer samples, after annealing in H2 atmosphere, was examined by Fourier transform infrared spectroscopy: the obtained spectra suggest that the samples with the Mg:Ni=2:1 atomic ratio contain the Mg2NiH4 phase while the samples with lower Ni concentration contain both the MgH2 and the Mg2NiH4 phases. The effect of the Ni additive on the stability of the deuteride phase was studied by thermal desorption spectroscopy (TDS). The TDS spectra of the single-phase Mg2NiD4 samples show a TDS peak at 400K. The TDS spectra of the two-phase samples show both the D2 desorption peak at 400K and a second peak at higher temperature that we attributed to the dissociation of the MgD2 phase. The high-temperature peak shifts to lower temperatures by increasing the Ni content. It is suggested that in the two-phase samples, the lattice volumes having the Mg2Ni structure resulting from the dissociation of the Mg2NiD4 phase reduce the thermodynamic stability of the MgD2 phase.