Periodic mesoporous materials formed through the cooperative self-assembly of surfactants and framework building blocks can assume a variety of structures1, 2, 3, and their widely tuneable properties make them attractive hosts for numerous applications4, 5, 6, 7. Because the molecular movement in the pore system is the most important and defining characteristic of porous materials8, it is of interest to learn about this behaviour as a function of local structure. Generally, individual fluorescent dye molecules can be used as molecular beacons with which to explore the structure of—and the dynamics within—these porous hosts9, 10, 11, 12, 13, and single-molecule fluorescence techniques provide detailed insights into the dynamics of various processes, ranging from biology14, 15 to heterogeneous catalysis16. However, optical microscopy methods cannot directly image the mesoporous structure of the host system accommodating the diffusing molecules, whereas transmission electron microscopy provides detailed images of the porous structure17, but no dynamic information. It has therefore not been possible to 'see' how molecules diffuse in a real nanoscale pore structure. Here we present a combination of electron microscopic mapping and optical single-molecule tracking experiments to reveal how a single luminescent dye molecule travels through linear or strongly curved sections of a mesoporous channel system. In our approach we directly correlate porous structures detected by transmission electron microscopy with the diffusion dynamics of single molecules detected by optical microscopy. This opens up new ways of understanding the interactions of host and guest.