Metal Machine is a tribute to heavy metal, written by Joakim Broden "in the bathroom, on toilet paper, with a cardboard beer crate as support."
Most of the song can be broken down line by line as referencing songs by other prominent metal artists.

Lyrics with referenced songs:

I have a phobia
A fear of the dark --- "Fear of the Dark," by Iron Maiden
Afraid to shoot strangers --- "Afraid to Shoot Strangers," by Iron Maiden
The animal talks

Guns scare me shitless
but love gun's my friend --- "Love Gun," by KISS
The sentinel's coming --- "Sentinel," by Judas Priest
But is this the end

Riding on this crazy train --- "Crazy Train," by Ozzy Osbourne
I'm going paranoid --- "Paranoid," by Black Sabbath
Watch me lose my mind
and break the law --- "Breaking the Law," by Judas Priest

I'm a metal machine
It's close to midnight and --- "Two Minutes to Midnight," by Iron Maiden
He's barking at the moon --- "Bark at the Moon," by Ozzy Osbourne
I'm a metal machine
The rainbow in the dark is shining --- "Rainbow in the Dark," by Dio

I'm only metal machine
It's close to midnight and
He's barking at the moon
I'm a metal machine
The kings of metal ride the sky --- "Kings of Metal," by Manowar

Is this st. anger --- "St. Anger," by Metallica
The ultimate sin --- "The Ultimate Sin," by Ozzy Osbourne
Or have I really
A black knight within --- the Canadian band Black Knight

The gates of Babylon --- "Gates of Babylon," by Rainbow
Are open and wide
Shout at the devil --- "Shout at the Devil," by Motley Crue
There's nowhere to hide

Fighting for the world to keep --- possibly "Fighting the World," by Manowar
The wild child in it's cage --- "Wild Child," by W.A.S.P.
Broke my metal heart --- "Metal Heart," by Accept
Against the wall --- "Balls to the Wall," by Accept

I'm a metal machine
It's close to midnight and
He's barking at the moon
I'm only metal machine
the rainbow in the dark is shining
I'm a metal machine
It's close to midnight and
He's barking at the moon
Come touch my metal machine
The kings of metal ride the sky