The growth of lava domes is often associated with cyclic variations of ground deformation, seismicity and mass flux of gas and magma. We present a model of cyclic volcanic activity which is controlled by degassing of supersaturated magma, magma flow into the conduit, gas escape from the permeable magma, deformation of the conduit walls and the friction between the walls and the plug at the top of the conduit. When the difference between magma pressure and ambient pressure exceeds the static friction, motion begins, bubbles expand and overpressure relaxes. Bubble expansion builds permeability, allows gas escape and faster depressurization. Depressurization and crystallization of the magma build supersaturation and gas diffusion from melt to bubbles. Gas flux into bubbles and magma flux from the chamber act to increase pressure. The rate of extrusion is controlled by the gas pressure, driving the motion, and by the rate-and state-dependent friction along shear zones between the plug and the host rock. When the magma overpressure drops to the dynamic strength of the slip surfaces, the plug sticks and blocks the vent. As bubble volume is now constant, exsolution of gas from the supersaturated melt leads to pressurization and begins a new cycle.