At the High Court in Glasgow judge Lord Burns told Connor Ward, 25, from Banff, Aberdeenshire, that he must serve at least six years before he is eligible for parole.
Ward, who was caught with an arms cache and bomb making equipment kept a list of mosques and pledged the “demise” of Islam.
Lord Burns told him: “The jury found you guilty and must have been satisfied you were in the course of preparing acts of terrorism.
“The jury’s view was that you formed an intention to attack a Mosque or Mosques in Aberdeen and would have acted alone. You had reached the stage of identifying your targets and expressed threats against Muslims.”
Lord Burns said that if Ward had carried out the acts of terrorism “It would have had catastrophic results.”
The judge added: “You had reached the stage of buying materials and you planned to cause serious injury at the least. Your obsession with weapons and explosives and your extreme right-wing attitudes presents serious risk to the public.”
Ward showed no emotion as he was led away to begin his sentence.
Police who searched his Banff, Aberdeenshire, home found hundreds of ball bearings, which could be used in pipe bombs, and rocket tubes capable of firing projectiles.
A stun gun, hundreds of knuckle dusters, knives and metal bars and deactivated bullets were also discovered.
Officers discovered the lethal hoard after receiving a tip-off that Ward had broken strict firearms legislation by buying a stun gun from abroad.
They also found Ward had acquired a mobile phone signal jamming device and a machine for picking up hidden bugs and downloaded tens of thousands of documents from the internet on firearms and survival techniques.
The files also contained extreme right-wing propaganda and documents about military tactics.
A map showing the addresses of five Mosques in the Aberdeen area were discovered on Ward’s computer.
They also found that Ward, who told jurors he thought Hitler had made mistakes, had started to compile a book called “Combat 18 British Mosque Address Book.”
Combat 18 is the name of an extreme British right-wing paramilitary group
On the title page of the book, Ward had written : “This book is dedicated to all that follow Mohammed and the Islamic faith. You will all soon suffer your demise.”
Ward, a former psychiatric patient, claimed he was suffering from mental illness at the time
Ward was jailed for three years in October 30, 2012, on a charge of contravening the 1883 explosives act by collecting the chemical components of a bomb with the intention of harming his father
He also received a 22 month jail sentence in April 2015 for possessing a stun gun.
Ward was also convicted in July 2016 of having an “improvised” knife while in jail and given an 18-month sentence.
Defence counsel Drew McKenzie said that Ward was a man with an interest in weapons and had been trying to sell weapons. He added that Ward had sent a stun gun to Amnesty International.