We present Hubble Space Telescope (HST) and Chandra imaging, combined with Very Large Telescope MUSE integral field spectroscopy of the counterpart and host galaxy of the first binary neutron star merger detected via gravitational-wave emission by LIGO and Virgo, GW170817. The host galaxy, NGC 4993, is an S0 galaxy at z - 0.009783. There is evidence for large, face-on spiral shells in continuum imaging, and edge-on spiral features visible in nebular emission lines. This suggests that NGC 4993 has undergone a relatively recent (less than or similar to 1 Gyr) "dry" merger. This merger may provide the fuel for a weak active nucleus seen in Chandra imaging. At the location of the counterpart, HST imaging implies there is no globular or young stellar cluster, with a limit of a few thousand solar masses for any young system. The population in the vicinity is predominantly old with less than or similar to 1% of any light arising from a population with ages <500 Myr. Both the host galaxy properties and those of the transient location are consistent with the distributions seen for short-duration gamma-ray bursts, although the source position lies well within the effective radius (r(e) similar to 3 kpc), providing an r(e)-normalized offset that is closer than similar to 90% of short GRBs. For the long delay time implied by the stellar population, this suggests that the kick velocity was significantly less than the galaxy escape velocity. We do not see any narrow host galaxy interstellar medium features within the counterpart spectrum, implying low extinction, and that the binary may lie in front of the bulk of the host galaxy.We thank the referee for a prompt and highly constructive report that improved the content and clarity of the manuscript. We also thank the editor, Fred Rasio, for helpful comments. Based on observations made with ESO Telescopes at the La Silla Paranal Observatory under programme ID 099.D-0668 (A.J.L.), and on observations made with the NASA/ESA Hubble Space Telescope, obtained from the data archive at the Space Telescope Science Institute. STScI is operated by the Association of Universities for Research in Astronomy, Inc. under NASA contract NAS 5-26555. These observations are associated with programs GO 14771 (N.R.T.), GO 14804 (A.J.L.), and GO 14850 (E.T.). We thank the staff at ESO and STScI for their excellent support of these observations. A.J.L. acknowledges that this project has received funding from the European Research Council (ERC) under the European Union's Horizon 2020 research and innovation programme (grant agreement No. 725246) A.J.L., D.S., and J.D.L. acknowledge support from STFC via grant ST/P000495/1. N.R.T., K.W., P.T.O., J.L.O., and S.R. acknowledge support from STFC. J.H. was supported by a VILLUM FONDEN Investigator grant (project number 16599). A.d.U.P., C.T., Z.C., and D.A.K. acknowledge support from the Spanish project AYA 2014-58381-P. Z.C. also acknowledges support from the Juan de la Cierva Incorporacion fellowship IJCI-2014-21669, and D.A.K. from Juan de la Cierva Incorporacion fellowship IJCI-2015-26153. M.I. was supported by the NRFK grant, No. 2017R1A3A3001362. E.T. acknowledges support from grants GO718062A and HSTG014850001A. S.R. has been supported by the Swedish Research Council (VR) under grant number 2016-03657_3, by the Swedish National Space Board under grant number Dnr. 107/16 and by the research environment grant "Gravitational Radiation and Electromagnetic Astrophysical Transients (GREAT)" funded by the Swedish Research council (VR) under Dnr 2016-06012. P.A.E. acknowledges UKSA support.Peer Reviewe