He was due to tackle Matteo Berrettini for a place in the quarter-finals.
However, having undergone two knee surgeries in 2020, the Swiss star had admitted there were doubts over whether he’d make it.
Federer is playing only his third tournament since last year’s Australian Open and has always said Wimbledon is his main goal.
After his four-set marathon against Koepfer on Sunday, the writing was on the wall.
“I’d prefer to be in Rafa’s or Novak’s shoes right now. I’m feeling good. If I’m playing well, I’m winning. I don’t have that feeling right now,” Federer said in the first indication that he was not planning to reappear for his last 16 clash with Berrettini.
“I need to decide if I keep on playing or is it not too much risk at this moment to keep on pushing. Is this just a perfect way to just take a rest?
“Because I don’t have the week in between here and Halle, like normal, to see what’s best now if you count back from Wimbledon.”