Instructions
Approach a port where you want to dock your vessel. Pay attention to the distance meter while moving forward.
Stop your boat once you are within about 50 km from the port. You don't need to come to a full stop but make sure you won't be in danger of crashing into anything. Press the "ESC" key to bring up a list of options.
Click the "Dock at ..." option to dock your U-boat. The menu option will indicate the name of the port you are near. For example, the menu option may say, "Dock at Kiel" if you are near the port of Kiel. Watch the docking animation to see your U-boat docking.