The pole, in a track record time of one minute 11.212 seconds, drew a huge roar from the crowd on a damp day at Hockenheim.
“It was amazing to see so many red flags, German flags, so much support around the track,” said the four-times world champion, who has yet to win a grand prix at the circuit nearest to where he grew up.
His only previous German victory was at the Nuerburgring in 2013 but he will be the clear favourite today to extend his overall lead in the championship.
“It just kept getting better and better, and I knew in the last lap I had more in me and I was able to squeeze everything out,” Vettel said of his lap.
Reigning champion Hamilton’s Finnish team mate Valtteri Bottas will start alongside Vettel on the front row, with Ferrari’s Kimi Raikkonen third and Red Bull’s Max Verstappen fourth on the grid.
Bottas had briefly held the provisional pole before Vettel’s final effort secured the German a 55th career top starting slot.
Hamilton, also a four-times champion and eight points behind Vettel, qualified 14th – assuming he does not need a new gearbox – after being sidelined by a hydraulics problem.
The Briton tried in vain to push the stricken car back to the pits, with the help of some marshals, before then crouching in some distress next to it after it had been wheeled off.
“I didn’t really understand exactly what had happened so in my mind I was thinking get the car back to the track, but they asked me to turn the car off,” said Hamilton, his dreams of a record-equalling fourth German GP win seemingly in tatters.
“I jumped out and wanted to push it back but it was so far to go.
“I saw there was leaking oil and I knew that I had to stop and let them put the car away somewhere. I have the will to not want to give up. I just want to keep pushing.”