I believe I saw boat anchored in Townsville but I haven't myself.
Best bet is to anchor
off Magnetic Island or go to the Marina at Nelly Bay on the S side of the island. I was there a couple of years ago and the marina was cheap
If you anchor in Horseshoe Bay on the N side of the island there are facilities on shore, shops restaurant etc., and a bus to the other side of the island.
There is a ferry
from Nelly Bay to Townsville.
Unless you need to go to Townsville particularly, Magnetic is the more popular stopover.
CASABLANCA L420 #86