The self-assembly of small organic molecules interacting via non-covalent forces is a viable approach towards the construction of highly ordered nanostructured materials. Among various molecular components, natural and unnatural nucleobases can undergo non-covalent self-association to form supramolecular architectures with ad hoc structural motifs. Such structures, when decorated with appropriate electrically/optically active units, can be used as scaffolds to locate such units in pre-determined positions in 2D on a surface, thereby paving the way towards a wide range of applications, e.g., in optoelectronics. This review discusses some of the basic concepts of the supramolecular engineering of natural and unnatural nucleobases and derivatives thereof as well as self-assembly processes on conductive solid substrates, as investigated by scanning tunnelling microscopy in ultra-high vacuum and at the solid/liquid interface. By unravelling the structure and dynamics of these self-assembled architectures with a sub-nanometer resolution, a greater control over the formation of increasingly sophisticated functional systems is achieved. The ability to understand and predict how nucleobases interact, both among themselves as well as with other molecules, is extremely important, since it provides access to ever more complex DNA- and RNA-based nanostructures and nanomaterials as key components in nanomechanical devices.