The results of a search for new heavy $W^\prime$ bosons decaying to an electron or muon and a neutrino using proton-proton collision data at a centre-of-mass energy of $\sqrt{s} = 13$ TeV are presented. The dataset was collected in 2015 and 2016 by the ATLAS experiment at the Large Hadron Collider and corresponds to an integrated luminosity of 36.1 fb$^{-1}$. As no excess of events above the Standard Model prediction is observed, the results are used to set upper limits on the $W^\prime$ boson cross-section times branching ratio to an electron or muon and a neutrino as a function of the $W^\prime$ mass. Assuming a $W^\prime$ boson with the same couplings as the Standard Model $W$ boson, $W^\prime$ masses below 5.1 TeV are excluded at the 95% confidence level.