Shulchan Aruch/Orach Chaim/248
1. It is permitted to commence a sea voyage, even on a Friday, if he is traveling for the purpose of a Mitzvah. He must agree [with the captain] to stop on Shabbat; if he subsequently [breaks this agreement] and does not stop it does not matter. For personal reasons (i.e. not for a Mitzvah) one may not commence the journey within three days of Shabbat. However, more than three days before [Shabbat] it is permitted, even in ships that will be dragged by animals and even if the depth of the water is less than ten hand breaths; even if a Jew will then be required to do a Melacha on Shabbat in order to steer the boat. If it a short journey, e.g. from Tyre to Sidon which is just one day's journey, one may commence travel on a Friday morning, since it is possible to arrive at the destination before Shabbat. In places where it is customary not to commence journeys on Friday at all, even short journeys, it is forbidden to do so.
2.The reason it is forbidden to commence a journey within three days of Shabbat is because of the enjoyment of Shabbat, since for the first three days travelers suffer discomfort and confusion. This only applies to sea voyages; travel in rivers do not cause any pain and it is therefore permitted to commence such a journey even on a Friday. This is only if we are not aware that the depth of the waters is less ten hand breaths; in places where we know that from the bottom of the boat to the bottom of the river the distance is less than ten hand breaths it is forbidden to travel outside of the Techum because of the prohibition of Techum. Likewise in a ship where a Jew will have to perform Melacha on Shabbat one should not enter three days before Shabbat, even if they are flowing rivers and the ship is above ten hand breaths. There is no prohibition, however, if animals have to drag the boat from the bank of the river and it is not the same as traveling in a wagon, which is forbidden.