We study the effect of local thermal nonequilibrium on the stability of a magnetic nanofluid layer in porous media under the influence of a uniform vertical magnetic field. The impact of three important mechanisms, namely Brownian motion, thermophoresis, and magnetophoresis is taken into account, whereas the Darcy model is selected for the porous medium. A three-temperature model is used to investigate the effect of local thermal nonequilibrium among the nanoparticle, fluid, and solid matrix phases. We analyze the stability of the layer under small perturbation and carry out numerical simulation in MATLAB for both the gravity and microgravity environment. The results demonstrate that the onset of convection slows down with an increase in the value of modify thermal diffusivity ratio eta(p) and eta(s) the porosity parameter epsilon, and interphase heat transfer coefficient between fluid and solid phase N-H S; but an increase in the value of concentration Rayleigh number R-p, modified thermal capacity ratio gamma(p), interphase heat transfer coefficient between fluid and particle phase N-HP, modified diffusivity ratio N-A, Lewis number Le, modified thermal capacity ratio gamma(s), and non linearity of magnetization M-3 advances the onset of convection. In addition, the Langevin parameter alpha(L), has a stabilizing and destabilizing effect on the system in the gravity and microgravity environment, respectively. It is also ob,crzvil that for a fixed value of particle phase (N-HP = 5), as the value of modified thermal capacity ratio gamma(p) increases from 50 to 200, the critical value of Ra decreases around 10.5% and 11.5% for water- and ester-based MNF, respectively. However, for the same set of values, a decrease around 3% for water-based MNF and 2% for ester-based MNF in the critical value of Ng is noticed in the microgravity environment.