In this study, the structural and magnetic properties of Si-doped bulk and 2D AlN were systematically investigated by first-principles calculations. Si atoms prefer to substitute Al atoms in both bulk and 2D AlN under N-rich growth conditions. In bulk AlN, Si dopants exhibit a non-magnetic state, uniform distribution, and a strong anisotropic diffusion energy barrier. In contrast to that, Si dopants prefer to form a buckling structure and exhibit a magnetic moment of 1 μB in 2D AlN. At a low Si concentration, Si atoms tend to get together with antiferromagnetic coupling between each other. However, the magnetic coupling among Si atoms changes to ferromagnetic coupling as Si concentration increases, due to the enhanced exchange splitting and delocalized impurity states. At the extreme doping limit, monolayer SiN, along with its analogs GeN and SnN, is a ferromagnetic semiconductor with a large band gap and high Curie temperature. These results indicate that 2D AlN doped by group IV atoms has potential applications in spintronic devices.