Q's first:
This alien species/hive/invasion vector has a population limit?
Your description implies strong atavism, so I'm assuming either they are not using tech and/or have no access to it at all?
Does the species know that humans exist elsewhere on the planet? Does it know anything much at all about how people live, about surface geography?
Is it even a singular species and forma? The implication here seems that it is, but as we don't know how they got there (etc.)
How are they getting on to land? Ports aren't particularly shallow waters and the surface beneath tends to rise relatively suddenly (not too sudden mind, you'd get crazy surface currents then) The assumption then is that they're not 'walking' in the water, but rather are capable swimmers.
This matters because it defines their ability to flank and expand the battlefront, and your ability to exploit their mobility.
Redirection & Attrition:
Whilst the city must be fortified if you wish to save it, your best course would probably be to encourage them to flank the city by clearing channels and creating killing fields such that only those closest to the city get whacked with utmost efficiency, this will naturally create a flanking effect as any attacking mob is more likely to follow somewhere where it's allies aren't dying immediately, so long as it thinks it's gaining ground. So you have your port 'circle' made as impenetrable as you can make it, perhaps with airstrikes clearing out occasional waves to give defenders a breathing space etc, whilst the land to either side is defending by one fallback position after another, leading the creatures inland. Once the taken land is saturated with enemies you carpet bomb the area and reclaim the territory or not and repeat the process.
Killing all of them in one place is not to your advantage, everything more intelligent than an ant will then try alternative routes.
Even if your humans have been preparing for quite a while any large scale poisoning will be difficult. First you have to know what is poisonous to these creatures(?) Secondly the sheer quantity of the substance you'll need is massive, so unless this is an extended war unlikely to come about. Your poison needs to be heavier than water so it sinks and doesn't just get carried away by currents or kept at the surface by physics, or deployed with 'precision' attacks..Well, actually that wouldn't be so hard.
L. Dutch suggests using electrofishing techniques which seems like a good idea, granted I'm operating purely on intuition merely from the word itself, and I'm not aware of contemporary technology or deployment practices in this. But it seems to me that a civilization with 'spaceships' has significant power sources and the other required materials to produce stable devices which could continuously pump massive amounts of electricity into a body of water. Clearly(?) the devices would boil if they operated continuously at high voltage, but conceivably they could be designed to do this and be dropped in waves, or designed to pulse less regularly. If deployed akin to 'depth charges' the source of the enemy could be assaulted in the same fashion.
It seems to me that unless your enemies are particularly resistant to both electricity and extreme changes in local water temperature, this or a similar approach is best and rather wastes the words I put into the beginning of the post :)
Saying that, you're trying to make a story and story kinda requires jeopardy, so you might want to come up with some way of making this less than totally effective.
///The aphis.usda link from xkcd has some material (and further references) covering current in water
Also: https://cdn.intechopen.com/pdfs-wm/21295.pdf (Edo D'Agaro, U. of Udine) should prove useful.
Now clearly electro-fishing techniques seek to reduce damage to the catch, so read accordingly.
//I'm not suggesting that you'd want to electrify the entire body of water, sorry if I omitted the proposal of 'depth charge'-like devices. The idea is that you can deploy (air or sea vessel drop) heavier than water devices (scale is up to you) that deploy current from internal generators (or you could connect them via cables to surface generators) with or without sensors/timers etc et al.
I'm also assuming that these creatures attack native fauna, or at least said fauna will keep a bit of distance, tho I don't know much about sea-life behavioral patterns it has to be said :)
There are corollary effects on the water and chemical constituents also especially with prolonged use.
Of some interest might be direct application of fairly simple chemical compounds...anything that can debond the compounds in saltwater, dropped in capsules and exposed to the water (of a sudden) will produce effects much like a bomb dropped in the water, but without the cost of formulating expensive chemical explosives.
Earlier I suggested that poison deployment would require too much material..and whilst this is true for a direct-effect toxin, you don't need to directly affect the creatures concerned, and as they're attacking you along 'horde' paths the water instead can be targeted. Anything that affects the oxygen content of the water will of course affect any creature trying to breathe it. The duration of such affects will of course be negligible, with the vast quantities of water involved, but localized areas akin to surface mustard gas clouds could be created by deployment of capsules.
Which brings up hydrolysis and anions as weapons of war.
I also forgot to ask how far out this hive is.
If it's a long way out, the depth of deployment means that these creatures aren't simply amphibious, but have a morphology capable of operating at very different pressure. Don't know if I need to go into the ramifications of this with you, but in order to be reasonable (and have your aliens be so) this ability will help to define their biology to some extent.
Attacking them at home specifically!
Waves/layers of depth charges dropped from aircraft/ships:
I'd suggest dropping them in a cylindrical shape, with electrical types on the outside with irregular pulsing to stop the zerg from being ordered into suiciding onto the bombs in order to carry them off, or whatever, with an with the inside of the 'cylinder' composed of munitions to actually destroy their base of operations. Bear in mind that you probably don't actually need to 'hit' anything with such munitions (depending on how badass these aliens and their BBEG's are) the scale of disruption you're causing at the ocean floor and the local water there is going to be pretty massive and extended..and aside from all the kinetic activity, gonna make the water silty as all hell and etc.