In this narrative review, we describe what is known about non-pharmacological and pharmacological treatments for insomnia in medical inpatients, with a focus on melatonin. Hospital-acquired insomnia is common, resulting in shortened total sleep time and more nighttime awakenings. Sleep disturbance has been shown to increase systemic inflammation, pain, and the likelihood of developing delirium in hospital. Treatment for insomnia includes both non-pharmacological and pharmacological interventions, the latter of which requires careful consideration of risks and benefits given the known adverse effects. Though benzodiazepines and non-benzodiazepine benzodiazepine receptor agonists are commonly prescribed (i.e., sedative-hypnotics), they are relatively contraindicated for patients over the age of 65 due to the risk of increased falls, cognitive decline, and potential for withdrawal symptoms after long-term use. Exogenous melatonin has a comparatively low likelihood of adverse effects and drug-drug interactions and is at least as effective as other sedative-hypnotics. Though more research is needed on both its effectiveness and relative safety for inpatients, small doses of melatonin before bedtime may be an appropriate choice for inpatients when insomnia persists despite non-pharmacological interventions.