"The nature of the crime was heinous, wanton and life-threatening ... it's inexplicable that anyone would do that intentionally", said US District Judge Richard Berman.
Rahimi had also exploded a device in Seaside Park, New Jersey, the day before the Chelsea bombing, and six pipe bombs he'd built were found in Elizabeth, New Jersey the day after.
Rahimi was born in Afghanistan but was a naturalized USA citizen.
"I don't harbor hate towards anyone", Rahimi added at one point, "but through life experience, I have learned to understand why there's such frustration between the Muslim community overseas and the American people".
Rahimi wasn't charged with terrorism, but his father, Mohammad Rahimi, said he contacted the Federal Bureau of Investigation to warn that his son may have been radicalized and the agency informed him his son wasn't engaged in terrorist behavior.
While imprisoned, Rahimi has completed classes in business, entrepreneurship and drama, Donaldson wrote.
In recent court papers, prosecutors painted Rahimi as a remorseless terrorist who was basking in his newfound infamy.
"(Another inmate) asked me how are we going to watch the news and I told him I don't need to watch the news because I am the news", Rahimi allegedly told a family member in a jailhouse phone call, while he was on trial. The videos clearly show Rahimi and the suitcase, in which he'd placed a pressure cooker bomb. Rahimi shared bomb-making instructions and speeches by terrorist leaders like Osama bin Laden and Anwar al-Awlaki. At Rahimi's two-week trial, prosecutors said it was a "miracle" that nobody was killed in the September 17, 2016 attack.
Investigators said Rahimi then planted two bombs in the Chelsea neighbourhood of NY but one failed to detonate. Discs of the materials were found in two inmates' possession.
Police arrested Rahimi on September 19, 2016, after a shootout outside the Linden, New Jersey, doorway where Rahimi had been sleeping.
Rahimi's lawyer, Xavier Donaldson, argued that the court should impose a sentence of only 15 years or less on top of the mandatory 30-year and life terms.
During the trial, the prosecution presented evidence - including DNA and fingerprints - linking Rahimi to the bombs that were placed in New Jersey and NY.