Chapter 74:3
Embarking on Ships
3. When it is permitted to board a ship on Friday, [there are also
leniencies that allow one to travel if the ship actually leaves on Shabbos
itself. This is the procedure which should be followed]:
One should board the ship on Friday and remain there until after nightfall.
Afterwards, even though one returns home and spends the night there, it is
permitted to board the ship again on Shabbos day (1), as long as the ship
is not traveling for the sake of Jews alone.
[There is, however, a difficulty.] Since the person spent Shabbos night in
his home, his home is considered his place of residence (2) (and he should
only be allowed to travel 2000 cubits from there). Therefore, if the ship
traveled beyond the 2000 cubits, and reached another port on Shabbos, he is
allowed to walk only four cubits in the [new] port (i.e. he may walk
throughout the entire ship, but may not disembark). (See also Chapter 95.)
FOOTNOTES:
(1) One is not allowed to travel more than 2000 cubits on Shabbos, from the
place one establishes one's "residence" at the onset of Shabbos; this law
is based on the verse: "A man shall not leave his place on the seventh day
(i.e. on Shabbos)" (Exodus 16:29). The area within the 2000 cubits is
called one's "Techum Shabbos." One of the reasons that it might be
forbidden to board a boat on Shabbos, is that it looks like you are
intending to travel beyond 2000 cubits on Shabbos. However, if one boards
the boat on Friday, and remains there until it gets dark (some require even
making Kiddush and eating a little on the boat), then the boat is seen as
his "home" for Shabbos ("konoh Shvisa"), and he may re-enter it on Shabbos
itself (Aruch Hashulchan 248:13).
(2) Remaining on the ship until nightfall on Friday night only serves to
allow him to re-enter the ship on Shabbos day. However, because he left the
boat on Friday night and spent the night in his house, his house is
considered to be his true Shabbos residence; therefore, if the ship travels
more than 2000 cubits from his house on Shabbos, he may not leave the
confines of the ship. (Mishna Berura 248:22)