We calculate the strength of the effective onsite Coulomb interaction (Hubbard $U$) in two-dimensional (2D) transition-metal (TM) dihalides MX$_2$ and trihalides MX$_3$ (M=Ti, V, Cr, Mn, Fe, Co, Ni; X=Cl, Br, I) from first principles using the constrained random-phase approximation. The correlated subspaces are formed from $t_{2g}$ or $e_g$ bands at the Fermi energy. Elimination of the efficient screening taking place in these narrow bands gives rise to sizable interaction parameters U between the localized $t_{2g}$ ($e_g$) electrons. Due to this large Coulomb interaction, we find $U/W >1$ (with the band width $W$) in most TM halides, making them strongly correlated materials. Among the metallic TM halides in paramagnetic state, the correlation strength $U/W$ reaches a maximum in NiX$_2$ and CrX$_3$ with values much larger than the corresponding values in elementary TMs and other TM compounds. Based on the Stoner model and the calculated $U$ and $J$ values, we discuss the tendency of the electron spins to order ferromagnetically.