Fix "Add to Favorites" for custom apps in Ubuntu

There is no “Add to Favorites” option in Ubuntu dock for custom apps. You will learn how to create a custom launcher and add to favorites in the dock.


Add standard application to Ubuntu dock

If you open any application from the Ubuntu menu and right-click on it in the dock, you will be able to pin it to the dock by selecting “Add to Favorites”:

Add to Favorites in Ubuntu

The application launcher will stay there after you close the app. That’s is the way to get a quick launcher for any app. However, this approach doesn’t work if you install an application not from the Ubuntu repository.

Add custom application to Ubuntu dock

Let’s say you have installed an application using an executable file and not the repositories. If you launch such an application and try to add it to favorites in the Ubuntu dock, you won’t find such an option in the context menu:

no Add to Favorites in Ubuntu

I don’t know why you cannot add to dock custom applications by default. And the only way to add it is to create a launcher manually.

For that, you need to create a yourapp.desktop file in /usr/share/applications/:

sudo nano /usr/share/applications/yourapp.desktop

Paste the following content:

#!/usr/bin/env xdg-open
[Desktop Entry]
Comment=Description of YourApp

Replace yourapp with your application and save by pressing Ctrl+O, Enter and Ctrl+X.

Make this file executable:

sudo chmod +x /usr/share/applications/yourapp.desktop

Log out and log in.

Open the Ubuntu Dash menu and you should be able to find your custom application in the menu. You can launch it from the menu.

custom app in Ubuntu menu

Also, if right-click on it, you should be able to select “Add to Favorites” and pin it to the dock panel:

Add to Favorites for custom app in Ubuntu

Now, when you close this application, a quick launcher will stay in the dock panel.

Create terminal launcher for custom application

Additionally, you can also create a quick launcher for this application to run it from the terminal.

Just create a file with the path to your application in /usr/local/bin/:

sudo echo /path/to/yourapp > /usr/local/bin/yourapp

Make it executable:

sudo chmod +x /usr/local/bin/yourapp

Now, if you run yourapp anywhere in the terminal, your custom application will launch.

Let me know in the comments if you know a better way to create a custom launcher in Ubuntu.

Please consider supporting this project:

Become a patron Buy me a coffeeBuy me a coffee Shop on Amazon Buy Linux Laptop Build Linux PC BTC: 1CfCLTYCqqDfYbngcvQtEav3n7SMZihfSS

Average Linux User
Average Linux User I am the founder of the Average Linux User project, which is a hobby I work on at night. During the day I am a scientist who uses computers to analyze genetic data.



Worked for me to add Eclipse to favorites: Launch the application –> Right click on the status bar of it (on top of the opened window) –> chose “Move to workspace down” –> right click on the icon in the launcher bar –> Add to favorites

Hope will help ;)


Tried that with Palemoon installed with gdebi from a deb package on Ubuntu 20.04. Worked fine for adding the app to the application menu, however it does not show the option to add to favorites on right clicking (when application opened in the dock). Any ideas? Thanks for the post, very useful


That did not work for me. I have tried the StartupWMClass didn't work. right click on running pgm was successful at adding to dock, but icon was wrong, and app didn't run, so that didn't work. Come one guys, this should not take hours to get to work. WHY Doesn't this work? it worked on 18, but functionality has been changed in 20. not cool


Thanks for this tutorial. It helps a lot! It worked fine on one of my pcs. But on the other it does this thing where it launches the app in a new icon : Any idea what could be causing this?

Average Linux User

Average Linux User

Hi Nicolas, Thank you for the comment. I do not experience that issue. I tested it with the Standard Notes AppImage:

#!/usr/bin/env xdg-open
[Desktop Entry]
Name=Standard Notes
Comment=Standard Notes

Do you run any additional GNOME extensions?


Hi, Thanks for your response. I run a couple of extensions : alternatetab, Always zoom workspaces, Noannoyance, Quick close in overview and user themes. But even disabling them doesn't help. I'll keep digging and come back to you if I find the cause of the problem.

Learn how to write in Markdown with this Quick Reference.
Notify me of new comments on this post.
* E-mail is used to display Gravatar.