An economical and easily movable molecular-beam epitaxy (MBE) apparatus which prepares magnetic ultrathin films and superlattices with atomically well controlled interfaces has been designed and constructed. Cleaning and characterization of substrates, sample deposition in a layer-by-layer fashion, and characterization of samples both during and after growth can be carried out in a single ultrahigh vacuum (UHV) chamber. This MBE apparatus is combined with UHV high-field magneto-optical instruments for in situ soft X-ray magnetic circular dichroism experiments on two-dimensional magnetic systems.