Federer broke Kohlschreiber in the opening game of the match and eased through the set 6-4.
But his 35-year-old German opponent hit back with his own early break in the second set and went on to win 6-3 as Federer struggled badly with his returns.
However, in the deciding set, Federer lifted his game, raced into a 3-0 lead and didn’t look back as he broke again to serve for the match.
And the Swiss world number seven finished the match with an ace.
It was Federer’s first match since losing in the Australian Open fourth round last month.
And Federer says he is just glad to win and move into the second round.
When asked after the match what he was most pleased about, Federer replied: “Getting through somehow.
“At the end of the day, it is the result that mattered tonight. Not if I felt good on the backhand or if the footwork was there.
“I hope that is going to fall into place the more matches I play here.
“These are the kind of matches you just have to find a way to win.
“I haven’t played since the Australian Open so that makes it a little bit more tricky.
“The wind makes it tricky. Philipp’s spins and kicks he puts on the ball makes it tough.
“The night session [because] I’ve been practising indoors in Switzerland.
“And in the day time here it is easier to practise and get rhythm. Then at night, it is just very different.
“So I’m just happy that somehow things got better in the third set. And actually, I’m very pleased with my level of play.”