How to add programs to the Unity Launcher or Ubuntu Dock?

How can I add new programs to the launcher (or the dock in Ubuntu 17.10 and later) in Ubuntu?

Asked By: Michał Tabor


Just launch the application you want to attach to the Unity Launcher or Ubuntu Dock; right click the icon and depending on your version of Ubuntu select the method below.

On Ubuntu 17.10 and later (with GNOME 3)

Select “Add to Favorites“:

(click to enlarge)

Alternatively, click the “Show Applications” icon, browse to the icon of the program you want to add, right click the program icon and you will see the option “Add To Favorites“. Selecting that option places the icon in the dock.

You can also drag applications directly from the Dash (or the ‘Show Applications‘ list / ‘Activities‘ overview) into the Ubuntu dock.

Before Ubuntu 17.10 (with Unity 7)

Select “Lock to Launcher“:

enter image description here

Answered By: Goddard

To add applications to the Dash (then you press the windows key), Go to ~/.local/share/applications and create your .desktop files there.

For example:

  • Open Nautilus (also called Files (the file manager))
  • Browse to ~/.local/share/applications (ctrl + h to show hidden folders/files)
  • Right click and choose create empty document
  • Name the file testing.desktop
  • Enter in a valid desktop contents (sample below)
  • Save it and now that entry will show when you press the windows key under applications.

A much easier way…

sudo apt-get install alacarte

Then run alacarte and create menu entries as you like. They will show in the unity launcher.

Sample desktop file (from sublime text 2)

#!/usr/bin/env xdg-open  

[Desktop Entry]
Name=Sublime Text 2
# Only KDE 4 seems to use GenericName, so we reuse the KDE strings.
# From Ubuntu's language-pack-kde-XX-base packages, version 9.04-20090413.
GenericName=Text Editor
Icon="/opt/Sublime Text 2/Icon/48x48/sublime_text.png"
Icon[en_US]=/opt/Sublime Text 2/Icon/128x128/sublime_text.png

[NewWindow Shortcut Group]
Name=New Window
Exec=subl -n
Answered By: coteyr
Categories: Answers Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.