How to Lock the Dock Size, Position, and Contents in OS X

| How-To

We recently discussed how you could quickly reposition the Dock in OS X, but some users are actually interested in the opposite: they want to lock the Dock down, so that children, guests, or other restricted users are prevented from making changes to its position, size, or contents. While there are no end-user options in the OS X interface to set these limitations, you probably won't be surprised to learn that these types of restrictions can be easily enabled with a few Terminal commands.

Lock the Dock Position

As the antithesis of our earlier tip, you can prevent changes to the position of the OS X Dock by running the following Terminal command:

defaults write com.apple.Dock position-immutable -bool yes; killall Dock

The first part of the command above prevents the user from changing the position of the Dock from its current position on the screen, so be sure you set the Dock to your desired location on the left, right, or bottom of the screen before running it. The second part of the command -- killall Dock -- resets the Dock so that the change will take effect, and it's necessary for enabling or disabling any of the commands discussed here.

os x lock dock position size

After this command is enabled, the options for changing the Dock's position in System Preferences > Dock will be grayed out, and the "Position" submenu in the Dock's context menu will be gone.

Lock the Dock Size

The next step to locking down the Dock in OS X is to prevent changes to its size. To do so, run the following Terminal command:

defaults write com.apple.Dock size-immutable -bool yes; killall Dock

After executing this command, the user will no longer be able to resize the Dock by clicking and dragging on the dividing line, or via the Size slider in System Preferences.

Again, this command will lock the Dock at its current size, so make sure you set the desired size before running it.

Lock the Dock Contents

Preventing changes to apps and folders listed in the Dock is perhaps the most important reason that users might want to lock it. Note that this doesn't prevent applications that are not in the Dock from being launched (a user can still launch apps via Finder or Spotlight, and those apps will have their icons appear in the Dock while running), it simply prevents a user from changing which apps and folders are "pinned" to the Dock and their position relative to each other.

To lock the Dock contents, run this command:

defaults write com.apple.Dock contents-immutable -bool yes; killall Dock

You'll now notice that you can't rearrange the position of apps on the Dock, add new apps by dragging them to the Dock from Finder, or use the right-click "Keep in Dock" option on a running application. You also won't be able to remove apps or folders from the Dock.

os x lock dock contents

As with the previous options, this locks the Dock as-is, so make sure that you not only add your desired apps and folders first, but that you also rearrange them if necessary into your preferred order.

Free the Dock!

You can undo any of the changes above by running the corresponding command again and simply changing "yes" to "no." For example, if we've locked everything down but we later decided that we want to let the user change the size of the Dock, we would run:

defaults write com.apple.Dock size-immutable -bool no; killall Dock

If you're typing commands manually, just remember to add "killall Dock" after each one in order for the change to take effect.

Also note that these are user-level commands, and while they're great for limiting access for young children or inexperienced users, any user with sufficient technical knowledge (or the ability to search Google for this article, for example) will be able to unlock any of the restrictions above. Therefore, it's best not to think of these settings as a security measure but rather as a handy trick that makes managing certain Macs a bit more convenient. Indeed, we've met a few users over the years who used some of these restrictions on their own accounts to prevent accidentally re-sizing the dock or removing certain apps, something that was a bit more common -- and frustrating -- in earlier versions of OS X.

Popular TMO Stories

Comments

oneof52

I did this command:

defaults write com.apple.Dock size-immutable -bool no; killall Dock

and the dock resets, but position is not greyed out in preferences and still jumps from screen to screen.  Any more info on locking the dock to the bottom of the left screen?

James Greene

Is there a command to keep it from jumping from one screen to another? With the Parallels/Win7 Start bar at the bottom of my secondary monitor and Photoshop’s Timeline at the bottom, and my tool options on the bottom of my CAD windows, my stupid Dock is all over the place, getting in the way all day. I HATE that the Dock works this way.

Pat Bhakta

There is no good way James,
This may sound weird and unrelated but it works for me. 
go to System Preferences > Mission Control then uncheck Displays have separate spaces.

This will disable a few other things though the most important is the second menu bar. To fix that download the free app SecondBar from http://blog.boastr.net/

Another annoying thing when using multi monitors is moving windows back and forth is a pain to resize or maximize, clicking the green button switches to full screen which I hate the most.  You could double click on the title bar but I often forget and click the stupid green one instead.

To fix that is download the app moom from the mac store its $10 but totally worth it if you are a power user.

James McLean

Unfortunately, this post contains a tiny error that prevents it from working.
The correct domain for the defaults command is com.apple.dock, with a lower case “d”.  The killall command still needss Dock with a capital “D” though.

Log in to comment (TMO, Twitter or Facebook) or Register for a TMO account