The 65-year-old actor - best known for playing Mickey Pearce in the hit BBC sitcom - has had a tumour removed from his lung, which was discovered by a scan after he referred himself to the doctor with stomach problems.
Murray revealed his diagnosis on Twitter and urged others not to dismiss similar symptoms.
Murray tweeted: "The other day I saw a gov advert advising anyone who has been suffering from bloating, pain or discomfort in the abdominal region and constipation to ask their GP to refer them for an ultrasound exam. It's quick totally painless and it can save your life.
This led to a pet scan which covers a much larger area .
To my wonderful surprise these lesions were not cancerous but the scan did find an EARLY stage cancerous tumour in my lung .
This has since been removed and I am tweeting now , which would not be the case if I hadn't
— Patrick Murray (@PatMurray000) January 21, 2022
"I now speak from my own experience.
"Naturally I wanted to keep my own health problems private , but failing to fully endorse this ad would be selfish. Thanks to my ultrascan I have a fighting chance. It showed my organs needed further investigation and tumours were spotted.
"This led to a PET scan which covers a much larger area . To my wonderful surprise these lesions were not cancerous but the scan did find an EARLY stage cancerous tumour in my lung.
"This has since been removed and I am tweeting now, which would not be the case if I hadn't had the ultrasound all those months ago.
"A lot of people put these symptoms down to age and the discomfort, to simply to having a weak stomach. Please don't ignore it if it persists. As for me and thanks to the NHS, I can now see the same beautiful horizon as you."
Murray also suffers from Chronic obstructive pulmonary disease which causes a number of breathing difficulties.
He appeared as comedy character Mickey - friend of the Trotter brothers Rodney and Del Boy - in 20 episodes of Only Fools And Horses between 1983 and 2003. His other acting roles include in gangster film The Firm with Gary Oldman.
After retiring from acting he became a taxi driver in Kent.
Murray appeared on Loose Women in 2017 to discuss the problems his wife and daughter were having getting granted a visa from the Home Office allowing them to come and live with him in the UK.
He met his wife Anong, 36, in Thailand where they married in 2016 and they share five-year-old daughter Josie.
Watch: The Only Fools and Horses van has been auctioned off