Catalyzes the transfer of galactose to ceramide, a key enzymatic step in the biosynthesis of galactocerebrosides, which are abundant sphingolipids of the myelin membrane of the central nervous system and peripheral nervous system. Galactosylates both hydroxy- and non-hydroxy fatty acid-containing ceramides and diglycerides. an N-acylsphing-4-enine + UDP-alpha-D-galactose = a beta-D-galactosyl-(1<->1')-N-acylsphing-4-enine + H(+) + UDP N-(2-hydroxy-hexanoyl)-sphing-4-enine + UDP-alpha-D-galactose = H(+) + N-(2-hydroxy-hexanoyl)-beta-D-galactosyl-sphing-4-enine + UDP N-(2-hydroxy-hexanoyl)-sphinganine + UDP-alpha-D-galactose = H(+) + N-(2-hydroxyhexanoyl)-beta-D-galactosylsphinganine + UDP an N-acyl-sphingoid base + UDP-alpha-D-galactose = a D-galactosylceramide + H(+) + UDP Sphingolipid metabolism; galactosylceramide biosynthesis. Belongs to the UDP-glycosyltransferase family.