Home Ubuntu How to Autostart Applications in Ubuntu

How to Autostart Applications in Ubuntu

by Kiran Kumar
Published: Updated:
Autostart apps Ubuntu

If you have a specific set of applications that you open every day regularly, you might want to try setting up autostart programs that will be executed after every PC boot process. For instance, I usually add a few applications like email, Shutter, Skype, and Color Picker apps to the startup list so that these will autostart after logging on to the PC.

Doing so, although it uses some PC resources, is a time-saver tweak for commonly used applications regularly. Some software comes with the auto-start feature in their respective “Preferences (if there is one)”, but generally, most won’t have it. Hence, here we go, let’s get started with this tutorial, which I hope will come in handy for you.

Autostarting Apps on Ubuntu

Before proceeding to the actual process to add an application to the startup list, you need first to know the command-line way of launching your app. By default settings, Ubuntu stores all the applications shortcuts in the following path:

/usr/share/applications/

Hence, please navigate to the path and search for the program name in the search box.

Step 1. Find out the command line for launching an application. For example, if my case, I want to add the “Transmission” app to the startup.

Step 2. Right-click on the application and select ‘Properties’. Copy the ‘Command’ row content. For my example, it is “transmission-gtk %U”. This is the actual terminal command that launches the program.

Finding the Command line of an Application

Finding the Command line of an Application

Step 3: Now that you know the command-line to execute, let’s configure and add it to the Startup Applications. We shall break the tutorial into two sections. Firstly, Ubuntu 16.04 and older that uses the Unity desktop environment, and secondly, the newer Ubuntu versions with the GNOME desktop.

On Ubuntu 16.04 LTS and Older (with Unity)

Launch the ‘Startup Applications’ from the Unity Dash menu. You can begin with typing “startup” for the result to appear.

Launch Startup Applications

Launch Startup Applications

Click ‘Add’ and paste the copied command in the ‘Command’ section. You can give ‘Name’ and ‘Comment’ whatever you want. Click ‘Add’.

Startup Applications - Add Program

Startup Applications – Add Program

The program will get added to the Startup Applications.

Startup Applications

Startup Applications

On Ubuntu 18.04 LTS and newer (with GNOME)

Click on “Activities”, look for “startup” and click on “Startup Applicatications” from the results.

Ubuntu 20.04 Activities Menu

Ubuntu 20.04 Activities Menu

Click on the ‘Add’ button and paste the command-line that you copied earlier into the ‘Command’ section. You can fill the optional ‘Name’ and ‘Comment’ fields with whatever you want. When done, click ‘Add’.

Startup Applications - Add Program

Startup Applications – Add Program

That’s it! Next time you restart your Ubuntu PC, you should see the added programs start automatically.

You may also like

7 comments

Dan July 12, 2017 - 4:37 PM

HI, thank you

any idea wyhy sometimes I cannot change the startup applications in 16.04? I add one and remove the SSH Keyring, save it, close it…on reopen its back to SSH Keyring only, my entry is lost…

Any idea how to amend that and is there a workaround?

Thx
Dan

Reply
Ingo July 14, 2017 - 10:04 AM

Mabye the autostart client doesn’t accept ~/… paths. f.e. to mount the google drive ocamlfuse I need to add: “google-drive-ocamlfuse start /home/IngosLaptop/googledrive”

instead of “google-drive-ocamlfuse start ~/googledrive”

Reply
Miquel July 28, 2017 - 7:12 PM

Hi Dan, for me it was the same. Finally I had to manually create a file to do the job (which is what the startup applications tool should do). Just search for ‘manually create .desktop file ubuntu’ or something similar and you will find posts like this one: https://askubuntu.com/questions/281293/creating-a-desktop-file-for-a-new-application

It is actually easy. I didn’t even write half of the lines in the file (i.e. the one for the icon) and it works fine. I think the most important line is the one starting with “Exect=” where you have to add the same path described in this article.

Best

Reply
Bob November 23, 2017 - 9:29 AM

How do you do this on a server with no GUI?

Reply
Kiran Kumar November 26, 2017 - 8:33 PM

You need to first create a .desktop file in ~/.config/autostart/ diectory. Then add this content to that file with the command you want:

cat << EOF >> ~/.config/autostart/yourcommandname.desktop
[Desktop Entry]
Type=Application
Exec=command
Name=yourcommandname
Comment=something
EOF

Reply
Tah February 12, 2018 - 2:56 AM

Thanks!

Reply
Uday April 9, 2018 - 12:41 PM

Hi Kiran,

Thanks for nice article. Does application run as root? and they start after all system and gpu drivers are loaded?

Thanks.

Reply

Leave a Comment

fl_logo_v3_footer

ENHANCE YOUR LINUX EXPERIENCE.



FOSS Linux is a leading resource for Linux enthusiasts and professionals alike. With a focus on providing the best Linux tutorials, open-source apps, news, and reviews written by team of expert authors. FOSS Linux is the go-to source for all things Linux.

Whether you’re a beginner or an experienced user, FOSS Linux has something for everyone.

Follow Us

Subscribe

©2016-2023 FOSS LINUX

A PART OF VIBRANT LEAF MEDIA COMPANY.

ALL RIGHTS RESERVED.

“Linux” is the registered trademark by Linus Torvalds in the U.S. and other countries.