How do I get the Ubuntu Dock off the secondary monitor?

CLI method:

You can disable the multiple monitors option for the dock by running the following command in Terminal:

gsettings set org.gnome.shell.extensions.dash-to-dock multi-monitor false

Then you can set your preferred monitor by running

gsettings set org.gnome.shell.extensions.dash-to-dock preferred-monitor <monitor-number>

(Put -1 in place of <monitor-number> for the primary monitor)

GUI method:

See the answer by singrium and the answer by Dan Dascalescu.
(GUI method may not work in special cases)


In Ubuntu 20.04 Focal Fossa, there's a simple setting you can configure in Appearance -> Dock -> Show on:

Change Dock settings in Ubuntu 20 Focal Fossa


You can get the sidebar back to your primary screen by doing the following.

  1. Open Settings.
  2. Go to Dock.
  3. On the section Show on, choose the screen you want to display the Dock in.

An example (Ubuntu 18.04):

enter image description here