Photonic integrated circuits hold great promise in enabling the practical wide-scale deployment of quantum communications; however, despite impressive experiments of component functionality, a fully operational quantum communication system using photonic chips is yet to be demonstrated. Here we demonstrate an entirely standalone secure communication system based on photonic integrated circuits—assembled into compact modules—for quantum random number generation and quantum key distribution at gigahertz clock rates. The bit values, basis selection and decoy pulse intensities used for quantum key distribution are chosen at random, and are based on the output of a chip-based quantum random number generator operating at 4 Gb s–1. Error correction and privacy amplification are performed in real time to produce information-theoretic secure keys for a 100 Gb s–1 line speed data encryption system. We demonstrate long-term continuous operation of the quantum secured communication system using feedback controls to stabilize the qubit phase and propagation delay over metropolitan fibre lengths. These results mark an important milestone for the realistic deployment of quantum communications based on quantum photonic chips.