Anelka struck three minutes after the interval, beating Porto goalkeeper Helton at the second attempt to put Chelsea top of the group.
But the Blues were forced to hang on towards the end of the game with goalkeeper Petr Cech making a handful of fine saves to ensure Chelsea ran out winners.
Anelka seized the chance to shine in the absence of banned striker Didier Drogba and Ancelotti was more than pleased with his contribution.
"Anelka is a great player,'' said the Italian. "With Drogba or without Drogba, he can play alone in the centre of the attack and together with Drogba. I am very happy for him because he is doing very well now.
"Our attacking play was good in the first half and we had a problem in the second half to maintain that. I don't think that Drogba was missed tonight.''
Ancelotti insisted that Porto's late flurry had not come as a surprise to him at all and warned that winning with style was something that had to be sacrificed at times.
"I was not anxious at the end of the match but we had a difficult time controlling the attacking play of Porto,'' said Ancelotti. "They played very well towards the end of the match. It is normal to have a difficult game but it was a good win for us. I think the first half was difficult as we wanted to pass the ball in the centre and Porto closed us down.
"After we scored we had opportunities to score a second goal but we didn't keep the ball or control the game towards the end. I know Porto very well, they are a very good team. They played football tonight very well. The amount of shots on goal they had was not a surprise to me.
"But if we win all the games, we cannot always play the best. Sometimes we have to win without playing well. This is another important thing for the team. It is impossible to play well in all the games. Sometimes we have to win with other characteristics. It was important to win and maintain confidence in the dressing room.''
Porto boss Jesualdo Ferreira said his side were unlucky not to come away from Stamford Bridge with a share of the spoils.
But Anelka's goal proved to be the killer blow for Porto who could not find an equaliser despite some classy counter-attacking in the final 20 minutes. "It is very difficult for us to swallow this result,'' said Ferreira. "Chelsea controlled the game in the first half and were very attacking but we reacted well.
"In the first half the game was more balanced. The goal was a bit unfair on us coming so soon after half-time. In the second half we were unlucky not to have scored goals ourselves. We controlled more of the game but this is the first game in the group and we are still in a good position.
"We didn't expect we would suffer a goal so early in the second half. I felt Chelsea could not keep up their speed and stamina so much all the time and would give us chances. Maybe we tried too hard to find a goal after they scored. We showed good quality and played our game but Chelsea are a very difficult team to play at home.''