Metallica rented an old United States Army barracks on the Presidio of San Francisco, and converted it into a makeshift studio in January 2001. As plans were being made to enter the studio to write and record its first album in nearly five years, the band postponed the recording because of the departure of bassist Jason Newsted. Newsted left Metallica on January 17, 2001, stating his departure was due to "private and personal reasons and the physical damage I have done to myself over the years while playing the music that I love". Uncomfortable with immediately writing and recording with a new bassist, Metallica opted to include Bob Rock as bassist. The band stated they would find another bass player upon the album's completion.
In July 2001, recording came to a halt when James Hetfield entered rehab for alcoholism and other undisclosed addictions. Hetfield returned to the band in April of the next year, but was only allowed to work on the album from noon to 4:00 PM. Due to his personal problems, as well as Metallica's internal struggles, the band hired a personal enhancement coach, Phil Towle. This, and the recording of the album, was documented by filmmakers Joe Berlinger and Bruce Sinofsky. The band's recording process was filmed over the course of three years. Subsequent to the album's release, Berlinger and Sinofsky released the edited material as the film Some Kind of Monster. From May 2002 until April 2003, the album was recorded at a new studio in San Rafael, California, known as "HQ".
St. Anger was the first album released by the band to feature songs in drop C tuning; eight of the eleven songs on the album were in this tuning, while "Dirty Window" was in drop D♭ tuning, "Invisible Kid" was in drop A♭ tuning and "The Unnamed Feeling" was in drop B♭ tuning. Only twice previously had Metallica released songs in tunings lower than D standard, with "Bad Seed" (from Reload) and "–Human" (from S&M) both in drop D♭ tuning.
Hetfield stated that the album was written with "a lot of passion". He said, "There's two years of condensed emotion in this. We've gone through a lot of personal changes, struggles, epiphanies, it's deep. It's so deep lyrically and musically. [St. Anger] is just the best that it can be from us right now." The band purposely wanted a raw sound on the album, so that Rock did not polish the sound while mixing. The band desired the raw sound because of the depth of the emotion they felt and did not want to "mess with it". Rock commented, "I wanted to do something to shake up radio and the way everything else sounds. To me, this album sounds like four guys in a garage getting together and writing rock songs. There was really no time to get amazing performances out of James. We liked the raw performances. And we didn't do what everyone does and what I've been guilty of for a long time, which is tuning vocals. We just did it, boom, and that was it."
After the departure of Jason Newsted
) in 2001, Robert Trujillo
) became Metallica's new bassist in February 2003 and toured with the band in support of St. Anger
Guitarist Kirk Hammett commented on the lack of guitar solos on St. Anger, a departure from what Metallica had done in the past: "We wanted to preserve the sound of all four of us in a room just jamming. We tried to put guitar solos on, but we kept on running into this problem. It really sounded like an afterthought." Hammett said that he was happy with the final product. Rock stated, "We made a promise to ourselves that we'd only keep stuff that had integrity. We didn't want to make a theatrical statement by adding overdubs."
Drummer Lars Ulrich achieved a unique sound on St. Anger by turning off the snares on his snare drum resulting in a drum tone with far more "ring" than is usual in rock and metal. This sound received much backlash from fans and critics alike. Ulrich said, "One day I forgot to turn the snare on because I wasn't thinking about this stuff. At the playbacks, I decided I was really liking what I was hearing—it had a different ambience. It sang back to me in a beautiful way." Regarding the backlash about the sound, he stated, "It's crazy, that kind of closed-mindedness." Rock said, "I would say I've only [done something] this brutal [sounding] when I've done demos. It probably sounds heavier because it's Metallica, but really this was a 15-minutes-on-the-drum-sound type of thing." When St. Anger was completed, Metallica hired a new, permanent bassist. In February 2003, Robert Trujillo joined the band. He appeared on the footage of studio rehearsals of St. Anger in its entirety, which was included on DVD in the album package. St. Anger was described as alternative metal.