Magnetic nanoparticles (MNPs) can organize into novel structures in solutions with excellent order and unique geometries. However, studies of the self-assembly of smaller MNPs are challenging due to a complicated interplay between external magnetic fields and van der Waals, electrostatic, dipolar, steric, and hydrodynamic interactions. Here, we present a novel all-atom molecular dynamics simulation method to enable detailed studies of the dynamics, self-assembly, structure, and properties of MNPs as a function of core sizes and shapes, ligand chemistry, solvent properties, and external field. We demonstrate the use and effectiveness of the model by simulating the self-assembly of oleic acid ligand-functionalized magnetite (Fe 3 O 4 ) nanoparticles, with spherical and cubic shapes, into rings, lines, chains, and clusters under a uniform external magnetic field. We found that the long-range electrostatic interactions can favor the formation of a chain over a ring, the ligands promote MNP cluster growth, and the solvent can reduce the rotational diffusion of the MNPs. The algorithm has been parallelized to take advantage of multiple processors of a modern computer and can be used as a plugin for the popular simulation software LAMMPS to study the behavior of small MNPs and gain insights into the physics and chemistry of different magnetic assembly processes with atomistic details.