This article describes the new primary proton beamline 1U at TRIUMF. The purpose of this beamline is to produce ultracold neutrons (UCN) for fundamental-physics experiments. It delivers up to 40 microA of 480 MeV protons from the TRIUMF cyclotron to a tungsten spallation target and uses a fast kicker to share the beam between the Center for Molecular and Materials Science and UCN. The beamline has been successfully commissioned and operated with a beam current up to 10 microA, facilitating first large-scale UCN production in Canada.