Background: The 17 F(p, γ) 18 Ne reaction is part of the astrophysical "hot CNO" cycles that are important in astrophysical environments like novae. Its thermal reaction rate is small owing to the relatively high energy of the resonances and therefore is dominated by direct, non-resonant capture in stellar environments at temperatures below 0.4 GK. Purpose: An experimental method is established to extract proton strength to bound and unbound states in experiments with radioactive ion beams and to determine the parameters of direct and resonant capture in the 17 F(p, γ) 18 Ne reaction. Method: The 17 F(d, n) 18 Ne reaction is measured in inverse kinematics using a beam of the short-lived isotope 17 F and a compact setup of neutron-, proton-, γ-ray and heavy-ion detectors called resoneut. Results: The spectroscopic factors for the lowest l = 0 proton resonances at Ec.m. = 0.60 MeV and 1.17 MeV are determined, yielding results consistent within 1.4σ of previous proton elastic-scattering measurements. The asymptotic normalization coefficients of the bound 2 + 1 and 2 + 2 states in 18 Ne are determined and the resulting direct-capture reaction rates are extracted. Conclusions: The direct-capture component of the 17 F(p, γ) 18 Ne reaction is determined for the first time from experimental data on 18 Ne.