We describe the processing of the PHANGS-ALMA survey and present the PHANGS-ALMA pipeline, a public software package that processes calibrated interferometric and total power data into science-ready data products. PHANGS-ALMA is a large, high-resolution survey of CO J=2-1 emission from nearby galaxies. The observations combine ALMAs main 12-m array, the 7-m array, and total power observations and use mosaics of dozens to hundreds of individual pointings. We describe the processing of the u-v data, imaging and deconvolution, linear mosaicking, combining interferometer and total power data, noise estimation, masking, data product creation, and quality assurance. Our pipeline has a general design and can also be applied to VLA and ALMA observations of other spectral lines and continuum emission. We highlight our recipe for deconvolution of complex spectral line observations, which combines multiscale clean, single scale clean, and automatic mask generation in a way that appears robust and effective. We also emphasize our two-track approach to masking and data product creation. We construct one set of broadly masked data products, which have high completeness but significant contamination by noise, and another set of strictly masked data products, which have high confidence but exclude faint, low signal-to-noise emission. Our quality assurance tests, supported by simulations, demonstrate that 12-m+7-m deconvolved data recover a total flux that is significantly closer to the total power flux than the 7-m deconvolved data alone. In the appendices, we measure the stability of the ALMA total power calibration in PHANGS--ALMA and test the performance of popular short-spacing correction algorithms.