The Portuguese champions had revenge on the mind after being dumped out by Jurgen Klopp's side in the last 16 of last year's competition but a disappointing first-half performance has given them an almighty task in next week's return fixture at the Estadio do Dragao.
Keita's second goal in less than a week got the Reds up and running after just five minutes before Firmino added a simple second in the 26th minute.
Liverpool did most of the pressing in the second half – Sadio Mane coming closest from long range – but they were unable to find a third that would have all but ended the tie as a contest.
Klopp's side started in typically pulsating fashion, powering into an early lead when Keita's low effort from 15 yards was heavily deflected past Iker Casillas by the flailing Oliver Torres.
Mohamed Salah then clipped past Casillas' left-hand post when it looked easier to score after 22 minutes.
His blushes were spared four minutes later, however, when Firmino tapped into an empty net from five yards after he had been picked out by Trent Alexander-Arnold's low cross.
Moussa Marega should have pulled Porto back into it shortly after the half-hour mark but his low effort was kept out by the left foot of Alisson.
Mane – whose earlier volley had been ruled out for offside – curled narrowly past Casillas' left-hand post from the edge of the penalty area 20 minutes from time.
Salah was lucky not to be shown a red card for an ugly challenge on Danilo Pereira in the closing stages as Porto – who again came close through Marega – ultimately fell short of finding an away goal that would have changed the complexion of next week's second leg.
What does it mean? Reds' double bid remains on course
Any thoughts that Liverpool's quest for a first Premier League title in 29 years would derail their Champions League campaign have been dispelled by a consummate first-leg performance. They never looked back after Keita's early strike and will be confident of finishing the job in Portugal next week. Porto, meanwhile, lacked quality in the final third and will consider themselves lucky to still be in with a chance of progressing to the last four.
Keita making his mark
It has been a stop-start first season for the Guinea international, but it looks like he is finding his feet at just the right time. He scored his first goal for the club in Friday's Premier League win over Southampton and opened his European account for Klopp's side in what was an all-action display.
Marega's run comes to an end
The Mali international was looking to become just the fourth player to score in seven successive Champions League matches. His previous accuracy was sorely missing, though, as he wasted five decent chances to grab a precious away goal.
Key Opta Stats
- Liverpool extended their unbeaten home run across all European competitions to 21 games (W15 D6); the Reds have kept 12 clean sheets in this run, conceding just 15 goals.
- Porto have never won away at an English club in 20 attempts in all European competitions (D3 L17), the most a club has played away at English opposition without ever earning a win.
- This was Jurgen Klopp’s 400th win as a manager in all club competitions, 111 of which have been with Liverpool (180 with Borussia Dortmund, 109 with 1. FSV Mainz 05).
- Porto have managed to win just one of their 19 away games in the knockout stages of the Champions League (D6 L11), losing both this season to Roma and Liverpool.
- Keita has scored two goals in his last two games for Liverpool in all competitions, having scored none in his first 27 appearances for the club beforehand.
- Since the start of last season, only Cristiano Ronaldo (24) has been directly involved in more goals in the Champions League than Liverpool's Roberto Firmino (21 - 13 goals, 8 assists).
Ahead of next week's second leg, Liverpool host Chelsea in the Premier League on Sunday, while Porto travel to Portimonese a day earlier in the Primeira Liga.