The relaxation of surface stress or strain constitutes an important mechanism in the formation (self-assembly) and ordering of nanostructures at surfaces. These stable, pre-patterned surfaces can further be used as templates for the fabrication of regularly nanostructured metallic or molecular films. Under appropriate conditions preferential nucleation or selective growth can lead to the replication of the template pattern. Two examples are discussed: The deposition of cobalt on the reconstructed Au(111)-(~22x3) surface and the adsorption of molecular films on the Cu(110)-(2x1)O stripe phase.