Before I explain how to get to Halong Bay, I should explain how to actually visit Halong Bay:
The only practical way to visit Halong Bay is to get on an organized cruise tour. There are some public ferries, but these are purely meant for transportation from one port to another, and does not go "through" the scenic island clusters
You generally don't first book your transportation to a port in Halong Bay and then buy a ticket there. Instead, you usually need to book your cruise tour first, either online or more commonly book through a local travel agency in Vietnam, and then the tour will take care of your transportation to the port where the cruise departs
While it's possible to go to a port first and then book a cruise there, most people (foreigners and locals alike) avoid doing this because prices are higher, selections are narrower, available cruise tickets may run out, and the experience is generally terrible because you have to worry about timing/delays since transportation is not integrated with your tour. Plus, there are three ports around Halong Bay, it's hard for you to know which one you have to go to (although Tuan Chau Harbor is usually the one for Halong Bay; the other two being Hon Gai Harbor and Got Harbor but cruises out of these two are for Bai Tu Long Bay and Lan Ha Bay, respectively)
You can book cruise tours online, or much more cheaply through local travel agencies in Vietnam (I'm talking about 30-40% cheaper for equivalent luxury level):
When you book a tour in Hanoi or Ha Long City: the tours will most likely include pick up from and drop off to your hotel
When you book a tour elsewhere in Vietnam: you will likely have to fly to either Hanoi or Hai Phong (which is the closest airport to Halong Bay), and the local tour guide will take care of your transportation
If you want to book online you can just Google "Ha Long Bay cruises" and lots of results will pop up. Again, you will likely be paying a 30-40% premium for the same tour because online sales are almost exclusively targeted at foreigners with high willingness to pay
Given all this, the question really becomes, how do you get to Hanoi or Halong City, and where can you book the tours
Getting to Hanoi is easy. It's the capital of Vietnam and there are lots of flights and trains to Hanoi that I won't cover here. Once you get to Hanoi, the best place to find a Halong Bay cruise tour is in the Old Quarter, specifically around here. Just walk around this area and you'll see lots of agencies selling all kinds of cruise tickets ranging from basic day tours to luxury cruises
How to get to Ha Long City: Halong City is a major town next to Halong Bay. It has lots of hotels and travel agencies all catering to visitors of Halong Bay, and is a good base to visit the bay
From Hanoi: The best way to get to Ha Long City is by coach bus or VIP van. Coach buses cost around $5-$10USD each way, and luxury vans cost $15-$25 each way. I highly recommend the luxury van option because the price differential isn't that big but the comfort level is much better. Bus operators include: Hung Duc, Kumho Viet Thahn. Van operators include: Rosa Eco Bus, Green Lion. Best way to book is through either 12Go or Baolau. Trip time is 2-3.5 hours
From the rest of Vietnam: fly to Hai Phong Cat Bi International Airport (HPH), and then take a taxi at the airport for about 550,000 VND ($24USD) including highway tolls. The distance between the airport and Ha Long City is 47km and the taxi will take about 1 hour
There are tour agencies all over Ha Long City. The biggest industry of the city is Halong Bay tourism after all! Don't worry about finding an agency; once you get there, just walk around any commercial area (or ask your hotel) and you will find lots of competing agencies for you to shop around for a cruise tour
To get to the harbors where the cruises actually depart from: If for whatever reason you need to get to the harbors yourself, I've detailed below how you can do so. As mentioned above, there are three harbors that Halong Bay cruises depart from:
How to get to Tuan Chau Harbor: this is the biggest harbor in the area and is the one that serves the cruises for the actual Halong Bay (green area in the map above). Harbor is located here.
From Ha Long City, you can take a taxi for 175,000VND ($7.5USD) by taxi or 150,000VND ($6.5USD) by Grab.
From Hai Phong Cat Bi International Airport, you can take a taxi for 525,000VND ($23USD), no Grab is available.
From Hanoi, there are VIP vans that can take you straight to Tuan Chau Harbor for 280,000VND ($12USD) operated by Xe Luxury. I'm sure there are other operators but I'm just not sure which ones. You should use 12Go or Baolau to check, just put Hanoi as the origin and Tuan Chau as the destination
How to get to Hon Gai Harbor: this harbor is mostly for cruises that tour Bai Tu Long Bay (yellow area in the map above), which is technically not Halong Bay but is part of the same area and looks similar. Harbor is located here
From Ha Long City: this harbor is actually located in Ha Long City, so it takes less than 90,000 VND ($4USD) to taxi or Grab to it from anywhere in Ha Long City
From Cat Bi International Airport, you will need to take the standard airport taxi to Ha Long City, which will cost you around 550,000 VND ($24 USD)
From Hanoi: there's not direct transportation to this harbor, so you will need to get to Ha Long City first (see instructions above) and then take a city taxi or Grab to the harbor for less than $4USD
How to get to Got Harbor: this harbor is mostly for cruises that tour Lan Ha Bay (light blue area in the map above), which again is not technically Halong Bay but it's just part of the same large region that people refer to as Halong Bay. Harbor located here
From Ha Long City, you can take a taxi for 650,000VND ($28USD) by taxi or 575,000VND ($25USD) by Grab.
From Cat Bi International Airport, you will need to take the standard airport taxi to Ha Long City, which will cost you around 330,000 VND ($14 USD)
First, you need to first take a train from Hanoi Railway Station to Hai Phong Railway Station. The train costs 75,000 VND - 85,000 VND ($3.25-$3.7USD) and takes 2h30min to travel. There are 4 daily trains departing at 6am, 9:17am, 3:20pm, and 6:15pm. Use Vietnam Railway's official booking site https://dsvn.vn to find the current schedule, but you can't book on there without a local Vietnamese bank account so you will need to buy your ticket in person at the train station. I recommend buying the ticket at least 1 day in advance
Then , after you get to Hai Phong Railway Station, take a taxi there to Got Harbor for 330,000VND ($14USD)