The process of introducing a phosphate group into an inhibitor of kappa B (I-kappaB) protein. Phosphorylation of I-kappaB targets I-kappaB for ubiquitination and proteasomal degradation, thus releasing bound NF-kappaB dimers, which can translocate to the nucleus to bind DNA and regulate transcription.