Short answer: macOS has no setting that makes the Dock stay on one screen. It is doing what Apple designed it to do.
There are three workarounds, and every one of them trades away something else. They are below, with the cost of each stated plainly.
The Dock is not assigned to a screen. It follows your pointer. Push the cursor to the bottom edge of any monitor and hold it there for a moment, and the Dock moves to that one. There is no setting anywhere in System Settings that will make it stay put.
This is intended behaviour, not a bug and not a sign anything is broken. On a single display you never notice, because there is nowhere else for it to go. Add a second monitor and the same rule turns into a Dock that appears wherever you last reached for something.
It is worse if you keep a browser or a video full screen on the second display, because the bottom edge of that screen is exactly where you go to reach the controls.
System Settings, Desktop & Dock, scroll to Mission Control, and turn off Displays have separate Spaces. Log out and back in.
Your monitors now behave as one large desktop, and the Dock settles on the main display and stays there.
What it costs you. This is the heaviest trade in the list. Each display no longer has its own Spaces, so full-screen apps stop behaving per-screen, and putting a video full screen on one monitor blanks the others. For a lot of multi-monitor setups that is a worse problem than the one you started with.
System Settings, Desktop & Dock, Position on screen, and choose Left or Right.
On a side edge the Dock has far fewer opportunities to be triggered, because you rarely drive the pointer into the outer edge of your monitor arrangement by accident, whereas you cross the bottom edge constantly.
What it costs you. A different Dock layout than you chose, and it reduces the problem rather than removing it. It is still possible to move it.
System Settings, Displays, click Arrange, and drag the white menu bar strip onto the display you want as your main one.
On its own this does not stop the Dock moving. It decides where the Dock lives by default and where it returns to, so it is worth doing alongside fix 1 rather than instead of it.
Most articles on this problem recommend this:
defaults write com.apple.dock autohide-delay -float 9999999; killall Dock
The idea was to make the delay before the Dock relocates so long it never happens in practice. It genuinely worked for years.
On current macOS it is unreliable, and it can do the opposite. Reports since Sonoma describe the Dock moving between displays faster rather than slower. Even the articles still recommending it now carry that warning. If you have already run it, undo it with:
defaults delete com.apple.dock autohide-delay; killall Dock
This is worth knowing because it is the top result for the problem on several sites, and it is out of date.
The pointer rule explains most of it, but not all. Three situations move the Dock without you going near the bottom edge.
After sleep or after unplugging a monitor. When displays disappear and come back, macOS rebuilds the arrangement, and the Dock lands on whichever display is currently main. If your external monitor is slower to wake than the Mac, the built-in screen is briefly the only one there, and the Dock stays on it once the external returns. There is no setting for this. Setting the external as your main display in Displays, Arrange makes it settle in the right place more often, but not always.
Clamshell mode. With the lid shut and the Mac on an external, there is only one screen, so the Dock behaves. Open the lid and you are back to two displays and the pointer rule. If the Dock ends up on the laptop screen the moment you open it, that is why.
Sidecar and an iPad as a second display. An iPad counts as a display, so the Dock will move to it. It catches people out because the iPad has its own Dock, and the Mac Dock arriving on top of it looks like a glitch. It is not.
The same behaviour is useful once you know it. To send the Dock to a particular monitor, push the pointer to the bottom edge of that screen and hold it there for a second or two. Push past the edge rather than stopping at it. The Dock moves across.
If nothing happens, the pointer is probably not far enough down. Keep pushing after the cursor appears to stop, because the trigger sits slightly beyond where it looks like the screen ends.
What people actually want is a setting that says "keep the Dock on this screen", and macOS has never had one. Every fix above works by removing the opportunity rather than by answering the request.
Still Dock adds that setting. It is an app that locks your Mac's Dock. Pick the display you want the Dock on and it stays there, without turning off separate Spaces, without moving the Dock to an edge you did not choose, and without a Terminal command that stopped working two macOS versions ago.
It is in both the direct download and the Mac App Store version, alongside the locks for size, position, hide and show, and contents.
No. macOS shows one Dock, on one screen at a time, and there is no setting or third-party app that changes it. If you searched for how to show the Dock on all screens, that is the answer, and what you are probably seeing is the Dock following your pointer between monitors. This guide is about stopping that.
Because displays come back at different speeds. If the external is slower to wake than the Mac, the built-in screen is momentarily the only display, and the Dock stays where it landed. Setting the external as your main display helps but does not fix it every time.
Yes, on any Mac with more than one display. It is standard macOS behaviour rather than a fault with your machine, your monitor or your cable.
Because full-screen controls sit at the bottom of the screen, so you push the pointer to the exact edge that summons the Dock. It is the most common way people run into this.
It changes them significantly. Full-screen apps stop being per-display, and one app going full screen can blank your other monitors. Try it for a day before committing to it.
No, that is a separate problem with a separate cause, the divider being a drag handle. See why your Dock keeps changing size.