This paper presents direct searches for lepton flavour violation in Higgs boson decays, H → eτ and H → μτ, performed using data collected with the ATLAS detector at the LHC. The searches are based on a data sample of proton-proton collisions at a centre-of-mass energy s = 13 TeV, corresponding to an integrated luminosity of 138 fb −1. Leptonic (τ → ℓνℓ ντ) and hadronic (τ → hadrons ντ) decays of the τ-lepton are considered. Two background estimation techniques are employed: the MC-template method, based on data-corrected simulation samples, and the Symmetry method, based on exploiting the symmetry between electrons and muons in the Standard Model backgrounds. No significant excess of events is observed and the results are interpreted as upper limits on lepton-flavour-violating branching ratios of the Higgs boson. The observed (expected) upper limits set on the branching ratios at 95% confidence level, B (H → eτ) < 0.20% (0.12%) and B (H → μτ) < 0.18% (0.09%), are obtained with the MC-template method from a simultaneous measurement of potential H → eτ and H → μτ signals. The best-fit branching ratio difference, B (H → μτ) → B (H → eτ), measured with the Symmetry method in the channel where the τ-lepton decays to leptons, is (0.25 ± 0.10)%, compatible with a value of zero within 2.5σ. [Figure not available: see fulltext.].