Porto pressed hard for an equaliser in the second half but Leicester held out to remain top of the Group G table, much to the delight of Ranieri.
"We suffered in the last 10mins but it was important to win," said the Italian.
"Concentration was high, we were resilient, I'm very happy.
"We played with our spirit tonight. The last pass wasn't always there, but Riyad (Mahrez) made one fantastic pass for Slimani."