The 31-year-old had a season left on his existing deal but has pledged his long-term future to the Pittodrie side.
The former England Under-21 cap said: “Hopefully I can keep improving. I feel I have improved a lot since I have been here, due to the staff, Gordon Marshall and the manager giving me confidence to go out and play like I have been.
“I feel there are plenty of years to improve my game. The five years are hopefully going to be the best years of my career.”
Lewis played most of his football in England with Peterborough and arrived in Scotland from Cardiff in 2016 after a move to Wales failed to work out.
“The first three days it rained solid so I thought ‘what have I done?’”, he said. “But once I started playing and training, even after the first few games the fans took to me, and it’s been enjoyable ever since.
“We have had plenty of ups and downs like any football club but my family are happy here, it’s a great city to bring my little boy up in, so all that combined made it a fairly straightforward decision.
“You want to win things and the clubs I have played for haven’t always been so stable as this one. You feel like everyone is pulling in the same direction.
“Silverware is something we need to aim for, I have just fallen short in my time here, but that’s definitely an aim.
“But there are other things to look forward to, the training ground next season and then, hopefully not too long after that, the new stadium. So it will be a great time to be part of the football club.”
Lewis, pictured, added: “Contract negotiations didn’t take particularly long. Once we actually sat down and spoke, it was done in a couple of weeks.”
Dons boss Derek McInnes faces losing the likes of Graeme Shinnie and Gary Mackay-Steven this summer so was delighted at Lewis’ eagerness to stay.
McInnes said: “I couldn’t be more pleased. We have taken the blows of players leaving and it’s important to celebrate this news. Joe was one we were really keen to keep.
“It’s a real shot in the arm to everyone at the club because he has been such a significant signing, a key person as well as a key performer.”