Garry Kane was living with 87-year-old Kathleen Milward in Stonehouse, South Lanarkshire, when he attacked her in January last year.
The 41-year-old was found guilty by majority verdict after a trial at the High Court in Dumbarton in November and was today sentenced to serve at least 17 years.
Passing sentence in Glasgow, Judge Lord Matthews said: "You were found guilty of the murder of your grandmother.
"It seems to me that no words of mine could bring home the enormity of that crime to greater effect than stating that fact alone.
"What made the crime more heinous was the fact that she was murdered in her own home, where she was entitled to feel safe, in brutal circumstances.
"There is no doubt that this crime has ripped apart your family, who themselves will effectively be subject to a life sentence and no sentence I pass can alleviate the anguish which they obviously feel or mitigate their loss."
Lord Matthews added: "It appears on the evidence that there was a close bond between you and your grandmother.
"She took you in when you were in need and you had every reason to be grateful to her.
"The evidence showed, however, that on the day in question you bought drugs with money which was not your own and I can only rationalise this crime on the basis that it arose out of a craving for heroin, a pernicious drug which has ruined many lives in the past and no doubt will continue to do so."
After Kane's conviction, Superintendent Robbie Allan, of Strathclyde Police, said: "This is undoubtedly a tragedy for the entire Milward family, who have and continue to go through a terrible ordeal made worse by the knowledge that a family member is responsible.
"Kathleen took Gary Kane in through her love for him and he repaid her kindness by murdering her.
"This was a complex investigation and we are content that we have been able to give the family the answer as to what happened to Kathleen."