Fungal secondary metabolites are synthesized by complex biosynthetic pathways catalized by enzymes located in different subcellular compartments, thus requiring traffic of precursors and intermediates between them. The β-lactam antibiotics penicillin and cephalosporin C serve as an excellent model to understand the molecular mechanisms that control the subcellular localization of secondary metabolites biosynthetic enzymes. Optimal functioning of the β-lactam biosynthetic enzymes relies on a sophisticated temporal and spatial organization of the enzymes, the intermediates and the final products. The first and second enzymes of the penicillin pathway, ACV synthetase and IPN synthase, in Penicillium chrysogenum and Aspergillus nidulans are cytosolic. In contrast, the last two enzymes of the penicillin pathway, phenylacetyl-CoA ligase and isopenicillin N acyltransferase, are located in peroxisomes working as a tandem at their optimal pH that coincides with the peroxisomes pH. Two MFS transporters, PenM and PaaT have been found to be involved in the import of the intermediates isopenicillin N and phenylacetic acid, respectively, into peroxisomes. Similar compartmentalization of intermediates occurs in Acremonium chrysogenum; two enzymes isopenicillin N-CoA ligase and isopenicillin N-CoA epimerase, that catalyse the conversion of isopenicillin N in penicillin N, are located in peroxisomes. Two genes encoding MFS transporters, cefP and cefM, are located in the early cephalosporin gene cluster. These transporters have been localized in peroxisomes by confocal fluorescence microscopy. A third gene of A. chrysogenum, cefT, encodes an MFS protein, located in the cell membrane involved in the secretion of cephalosporin C, although cefT-disrupted mutants are still able to export cephalosporin by redundant transporters. The secretion of penicillin from peroxisomes to the extracellular medium is still unclear. Attempts have been made to identify a gene encoding the penicillin secretion protein among the 48 ABC-transporters of P. chrysogenum. The highly efficient secretion system that exports penicillin against a concentration gradient may involve active penicillin extrusion systems mediated by vesicles that fuse to the cell membrane. However, there is no correlation of pexophagy with penicillin or cephalosporin formation since inactivation of pexophagy leads to increased penicillin or cephalosporin biosynthesis due to preservation of peroxisomes. The penicillin biosynthesis finding shows that in order to increase biosynthesis of novel secondary metabolites it is essential to adequately target enzymes to organelles.