The chemical reactions and pathways resulting in the formation of galactosylceramides, any compound formed by the replacement of the glycosidic hydroxyl group of a cyclic form of galactose by a ceramide group.
galactosylceramide biosynthesis