Background: Up to 40 per cent of patients undergoing oesophagectomy develop pneumonia. The aim of this study was to assess whether preoperative inspiratory muscle training (IMT) reduces the rate of pneumonia after oesophagectomy. Methods: Patients with oesophageal cancer were randomized to a home-based IMT programme before surgery or usual care. IMT included the use of a flow-resistive inspiratory loading device, and patients were instructed to train twice a day at high intensity (more than 60 per cent of maximum inspiratory muscle strength) for 2 weeks or longer until surgery. The primary outcome was postoperative pneumonia; secondary outcomes were inspiratory muscle function, lung function, postoperative complications, duration of mechanical ventilation, length of hospital stay and physical functioning. Results: Postoperative pneumonia was diagnosed in 47 (39·2 per cent) of 120 patients in the IMT group and in 43 (35·5 per cent) of 121 patients in the control group (relative risk 1·10, 95 per cent c.i. 0·79 to 1·53; P = 0·561). There was no statistically significant difference in postoperative outcomes between the groups. Mean(s.d.) maximal inspiratory muscle strength increased from 76·2(26·4) to 89·0(29·4) cmH2O (P < 0·001) in the intervention group and from 74·0(30·2) to 80·0(30·1) cmH2O in the control group (P < 0·001). Preoperative inspiratory muscle endurance increased from 4 min 14 s to 7 min 17 s in the intervention group (P < 0·001) and from 4 min 20 s to 5 min 5 s in the control group (P = 0·007). The increases were highest in the intervention group (P < 0·050). Conclusion: Despite an increase in preoperative inspiratory muscle function, home-based preoperative IMT did not lead to a decreased rate of pneumonia after oesophagectomy. Registration number: NCT01893008 (https://www.clinicaltrials.gov).