  Cosmic rays are thought to escape their sources streaming along the local
magnetic field lines. We show that this phenomenon generally leads to the
excitation of both resonant and non-resonant streaming instabilities. The
self-generated magnetic fluctuations induce particle diffusion in extended
regions around the source, so that cosmic rays build up a large pressure
gradient. By means of two-dimensional (2D) and three-dimensional (3D) hybrid
particle-in-cell simulations, we show that such a pressure gradient excavates a
cavity around the source and leads to the formation of a cosmic-ray dominated
bubble, inside which diffusivity is strongly suppressed. Based on the trends
extracted from self-consistent simulations, we estimate that, in the absence of
severe damping of the self-generated magnetic fields, the bubble should keep
expanding until pressure balance with the surrounding medium is reached,
corresponding to a radius of $\sim 10-50$ pc. The implications of the formation
of these regions of low diffusivity for sources of Galactic cosmic rays are
discussed. Special care is devoted to estimating the self-generated diffusion
coefficient and the grammage that cosmic rays might accumulate in the bubbles
before moving into the interstellar medium. Based on the results of 3D
simulations, general considerations on the morphology of the $\gamma$-ray and
synchrotron emission from these extended regions also are outlined.
