Vitamin D is a hormone that is synthesised in the skin in the presence of sunlight. Sufficient vitamin D levels are important—not only for a healthy skeleton—but also for a healthy immune system. Many patients with cancer have insufficient vitamin D levels, and low vitamin D levels are associated with increased ‘all-cause mortality’ and especially mortality due to cancer. Low vitamin D levels have also been associated with increased risk of infections, increased pain, depressive disorders and impaired quality of life. We review the role of vitamin D in the immune system, in relation to cancer disease, pain and depression. We have recently performed an observational study in 100 patients with palliative cancer in Sweden. The main result was that low vitamin D levels were associated with higher opioid dose, that is, more pain. We also describe a case report where vitamin D supplementation resulted in radically decreased opioid dose, less pain and better well-being. Vitamin D supplementation is not connected with any adverse side effects and is easy to administrate. Thus, we hypothesise that vitamin D-supplementation to patients with palliative cancer might be beneficial and could improve their well-being, decrease pain and reduce susceptibility to infections. However, more clinical studies in this field are needed before firm conclusions can be drawn.