Organelle biogenesis requires proper transport of proteins from their site of synthesis to their target subcellular compartment1-3. Lysosomal enzymes are synthesized in the endoplasmic reticulum (ER) and traffic through the Golgi complex before being transferred to the endolysosomal system4-6, but how they are transferred from the ER to the Golgi is unknown. Here, we show that ER-to-Golgi transfer of lysosomal enzymes requires CLN8, an ER-associated membrane protein whose loss of function leads to the lysosomal storage disorder, neuronal ceroid lipofuscinosis 8 (a type of Batten disease)7. ER-to-Golgi trafficking of CLN8 requires interaction with the COPII and COPI machineries via specific export and retrieval signals localized in the cytosolic carboxy terminus of CLN8. CLN8 deficiency leads to depletion of soluble enzymes in the lysosome, thus impairing lysosome biogenesis. Binding to lysosomal enzymes requires the second luminal loop of CLN8 and is abolished by some disease-causing mutations within this region. Our data establish an unanticipated example of an ER receptor serving the biogenesis of an organelle and indicate that impaired transport of lysosomal enzymes underlies Batten disease caused by mutations in CLN8.