That entirely depends on the city. In early medieval London, for example, there were wharves at both Anglo-Saxon Lundenwic outside the Roman walls, as well as inside the walls following Alfred's restoration of the defences in 886 (Vince, 1990, Saxon London). At Exeter on the other hand, the docks were outside the walls, as the river ran below the promintory on which the Roman walls were built.