Temporal variation of effective population size and gene flow determine current patterns of genetic diversity within species, and hence the genetic variation upon which natural selection can act. Although such demographic processes are well understood in terrestrial organisms, they remain largely unknown in the ocean, where species diversity is still being described. Here, we present one of the first population genomic studies in a cephalopod, Octopus insularis, which is distributed in coastal and oceanic island habitats in the Atlantic Ocean, Mexican Gulf and the Caribbean Sea. Using genomic data, we identify the South Equatorial current as the main barrier to gene flow between southern and northern parts of the range, followed by discontinuities in the habitat associated with depth. We find that genetic diversity of insular populations significantly decreases after colonization from the continental shelf, also reflecting low habitat availability. Using demographic modelling, we find signatures of a stronger population expansion for coastal relative to insular populations, consistent with estimated increases in habitat availability since the Last Glacial Maximum. The direction of gene flow is coincident with unidirectional currents and bidirectional eddies between otherwise isolated populations, suggesting that dispersal through pelagic paralarvae is determinant for population connectivity. Together, our results show that oceanic currents and habitat breaks are determinant in the diversification of marine species, shaping standing genetic variability within populations. Moreover, our results show that insular populations are particularly vulnerable to current human exploitation and selective pressures, calling the revision of their protection status.