A search for the standard model Higgs boson produced in association with a top-quark pair, ttH, is presented. The analysis uses 36.1 fb-1 of pp collision data at s=13 TeV collected with the ATLAS detector at the Large Hadron Collider in 2015 and 2016. The search targets the H→bb decay mode. The selected events contain either one or two electrons or muons from the top-quark decays, and are then categorized according to the number of jets and how likely these are to contain b-hadrons. Multivariate techniques are used to discriminate between signal and background events, the latter being dominated by tt+jets production. For a Higgs boson mass of 125 GeV, the ratio of the measured ttH signal cross-section to the standard model expectation is found to be μ=0.84-0.61+0.64. A value of μ greater than 2.0 is excluded at 95% confidence level (C.L.) while the expected upper limit is μ<1.2 in the absence of a ttH signal.