Amla made 102 not out and Cook was unbeaten on 91 as South Africa reached 224 for one at tea. The pair's second wicket partnership was worth 189 at the interval.
Amla, four months younger than Cook but 91 matches richer in Test experience, was back to his fluent best as he reached his century off 131 deliveries with 18 fours.
Cook, 33, displayed the old-fashioned virtues of a specialist opening batsman. He left alone balls that threatened danger outside the off stump and was strong off his legs, punctuated by the occasional firm drive through the off side.
A freak catch by James Taylor at short leg was England's only success after South Africa won the toss and decided to bat.
Also Read
Dean Elgar and Cook put on 35 for the first wicket before Elgar was caught by Taylor off Moeen Ali for 20 when the off- spinner was brought into the attack in the 11th over.
Amla was dropped on five when he edged Ben Stokes low to first slip, where Alastair Cook, possibly obscured by diving wicketkeeper Jonny Bairstow, put down the chance.
Stephen Cook had a life on 47 when Bairstow again dived in front of Alastair Cook and spilled a difficult chance off Stuart Broad. Cook was one of five changes from the South African side beaten by seven wickets in the third Test in Johannesburg last week.
Chris Woakes replaced the injured Steven Finn in the only change in the England team.
England hold a winning 2-0 lead in the series.