HL-2M is a medium-sized copper-conductor tokamak under construction at the Southwestern Institute of Physics. The designed plasma parameters of HL-2M are as follows: $\text{plasma}\ \text{current}=2.5\ \text{MA}$, $\text{toroidal}\ \text{field}=2.2\ \text{T}$, $\text{major}\ \text{radius}=1.78\ \text{m}$, $\text{minor}\ \text{radius}=0.65\ \text{m}$, $\text{flux swing} > 14\ \text{V}\cdot\text{s}$, and plasma pulse ∼5 s, with a plasma shape of $\text{elongation}=2$ and $\text{triangularity} > 0.5$. To fulfill physics needs, the HL-2M coil system is designed to drive, shape, and confine plasma. It includes poloidal field coils and toroidal field coils (TFCs). HL-2M takes advantage of a demountable TFC to facilitate assembly of components inside the TFC and make the whole tokamak flexible for experiment and operation and provide good accessibility to plasma for plasma heating, diagnostic, and control. This structure also results in difficulties to design and fabricate magnets. The design and development of the coils are presented.