The diffusion, adsorption/desorption behaviors of water molecules and hydrogen molecules are of great importance in heterogeneous photocatalytic hydrogen production. In the study of structure–property-performance relationships, nanoconfined space provides an ideal platform to promote mass diffusion and transfer due to their extraordinary properties that are different from the bulk systems. Herein, we designed and prepared a nanoconfined CdS@SiO2-NH2 nanoreactor, whose shell is composed of amino-functionalized silica nanochannels, and encapsulates spherical CdS as a photocatalyst inside. Experimental and simulated results reveal that the amino-functionalized nanochannels promote water molecules’ and hydrogen molecules’ directional diffusion and transport. Water molecules are enriched in the nanocavity between the core and the shell, and promote the interfacial photocatalytic reaction. As a result, the maximized water enrichment and minimized hydrogen-occupied active sites enable photocatalyst with optimized mass transfer kinetics and localization electron distribution on the CdS surface, leading to superior hydrogen production performance with activity as high as 37.1 mmol·g−1·h−1.