© 2015 AIP Publishing LLC. Magnetic skyrmions are promising candidates as information carriers in a new generation of memories. Here, we study the physical conditions for nucleating and stabilizing skyrmions by using local magnetic fields. We theoretically demonstrate how skyrmions can be imprinted in ultrathin ferromagnetic films, either individually and also in large numbers by bringing a magnetic nanostructured template close to the film. In this latter case, two kinds of templates, allowed by present-day nanotechnologies, are proposed: arrays of ferromagnetic nanorods or superconducting vortices.