The master of a ship is bound to be always on board when entering or leaving a port, harbor, or river.

SOURCE: CC § 2035.