Captains of sailing ships used to live in cabins in the stern (rear) of the ship, for several reasons;
The Bridge was in the rear of the ship. With the wheel being in the rear and connected to the rudder that is where the Captain would be working. Therefore, he slept and spent his free time right below the Bridge. The crew may have to wake the Captain during an emergency, and he then would quickly come to the Bridge.
This location provided more comfort. The stern of the ship is wider than the bow and the Captain enjoyed a roomier cabin. Furthermore, the Captain had his own toilet, while crew’s toilets where in the bow and had wooden channels leading to the sea. Those channels smelled, as did the crew because of their lack of hygiene. The Captain did not have to endure such smelly discomfort because the wind always came from the rear of the ship and blew through the large ornate Quarter Gallery windows.
Finally, the stern of the ship is much more stable. Waves typically move the bow of the ship more, which makes the stern a bit calmer and more comfortable, especially during stormy weather. It was also a bit quieter and more private to accommodate meetings with officers and strategic planning.
When in the Captains Quarters be sure to listen for and locate Davey Jones beating heart.