The production of D± and D±s charmed mesons is measured using the D±/D±s → ϕ(μμ)π± decay channel with 137 fb−1 of √s = 13 TeV proton-proton collision data collected with the ATLAS detector at the Large Hadron Collider during the years 2016–2018. The charmed mesons are reconstructed in the range of transverse momentum 12 < pT < 100 GeV and pseudorapidity |η| < 2.5. The differential cross-sections are measured as a function of transverse momentum and pseudorapidity, respectively, and compared with next-to-leading- order QCD predictions. The predictions are found to be consistent with the measurements in the visible kinematic region within the large theoretical uncertainties.