Dockett signed a two-year, $7.5 million contract with the 49ers, with $4 million being paid in the first season and $2 million guaranteed, a league source told ESPN NFL Insider Adam Schefter.
Dockett's 11-year run with the Arizona Cardinals ended Friday when the team released him. The Cardinals were open to re-signing him at a lower rate than the $6.8 million he was scheduled to earn in 2015.
The 33-year-old missed all of the 2014 season after tearing his ACL during training camp in August. Before last season, Dockett had missed two games in 10 seasons.
He strengthens the 49ers' defensive line while weakening a division rival in the Cardinals. His signing also might signal that the 49ers won't wait for Justin Smith to decide whether to retire or return for a 15th season.
Dockett finished his career with the Cardinals with 459 tackles, 40.5 sacks, 12 fumble recoveries, seven forced fumbles and four interceptions.
His three sacks in Super Bowl XLIII tied Reggie White for most in a Super Bowl.
The Cardinals tweeted a thank-you to Dockett for his 11 seasons with the team on Thursday.
ESPN.com 49ers reporter Paul Gutierrez contributed to this report.
Dockett Joins 49ers
Jim Trotter discusses why Darnell Dockett signed a two-year, $7.5 million contract with the 49ers.