The 31-year-old arrives from Sheffield Wednesday to provide competition for David Forde, becoming Steve Lomas' first signing as Lions boss in the process.
Lomas said: "We already have an excellent keeper in David Forde and I'm hoping to persuade David to sign a new extended contract.
But you need competition for places in all areas of the team, and at 31 Stephen is a good age for a keeper with a wealth of experience at this level to push Fordey for his place in the team."
Bywater added: "I know David very well from our time together at West Ham and I'm looking forward to working with him again. I'm delighted to be joining Millwall and in doing so, first and foremost I will be a team player determined to do whatever is required by the manager for the club.
"However, I want to be playing as much first team football as possible, so I'll be challenging Fordey hard for that number one spot in the team, as he would expect."