How To Run A Program At Startup Using Ubuntu

Ubuntu Documentation

Ubuntu Startup Applications
Run Applications At Startup Using Ubuntu.



In this guide you will be shown how to launch applications when Ubuntu starts.

You will be pleased to know that you don't need the terminal at all to be able to do this as there is a fairly straight forward graphical tool to help you on your way.

Startup Application Preferences

The tool used to get applications to start when Ubuntu loads is called "Startup Application Preferences". Press the super key (Windows key) on the keyboard to bring up the Ubuntu Dash and search for "Startup".

It is likely that two options will present themselves to you. One will be for the "Startup Disk Creator" which is a guide for another day and the other is "Startup Applications".

Click on the "Startup Applications" icon. A screen will appear like the one in the image above.

There will already be some items listed as "Startup Applications" and I recommend that you leave these alone.

As you can see the interface is fairly straight forward. There are just three options:

  • Add
  • Remove
  • Edit

Add A Program As A Startup Application

To add a program at startup click the "Add" button.

A new window will appear with three fields:

  • Name
  • Command
  • Comment

Enter the name of something that you will recognise in the "Name" field. For instance if you want "Rhythmbox" to run at startup type "Rhythmbox" or "Audio Player".

In the "Comment" field give a good description of what is to be loaded.

I deliberately left the "Command" field until last as it is the most involved part of the process.

The "Command" is the physical command you wish to run and it can be a program name or the name of the script.

For example to get "Rhythmbox" to run at startup all you have to do is type "Rhythmbox".

If you don't know the correct name of the program you need to run or you don't know the path click the "Browse" button and look for it.

When you have entered all the details click "OK" and it will be added to the startup list.

How To Find The Command For An Application

Adding Rhythmbox as an application at startup was quite easy because it is the same as the name of the program.

If you want something like Chrome to run at startup then entering "Chrome" as the command will not work. 

The "Browse" button isn't particularly very useful on its own because unless you know where the programs are installed it is hard to find them.

As a quick tip most applications are installed in one of the following locations:

  • /usr/bin
  • /usr/sbin
  • /usr/local/bin
  • /usr/local/sbin

If you know the name of the program you wish to run you can open a command prompt by pressing CTRL, ALT and T and entering the following command:

which google-chrome

This will return the path to the application. For example the above command will return the following:


It won't be immediately obvious to everyone however that to run Chrome you have to use google-chrome.

An easier way to find out how a command is run is to physically open the application by selecting it from the Dash.

Simply press the super key and search for the application you wish to load at startup and click the icon for that application.

Now open a terminal window and type the following:

top -c

Click here for a video showing more about the top command.

A list of the running applications will be displayed and you should recognise the application you are running.

The best thing about doing it this way is that it provides a list of switches that you might wish to include as well.

Copy the path from the command and paste it into the "Command" field on the "Startup Applications" screen.

Writing Scripts To Run Commands

In some cases it isn't a good idea to run the command at startup but to run a script which runs the command. 

A good example of this is the Conky application which displays system information on your screen.

In this case you won't want Conky to load until the display has fully loaded and so a sleep command prevents Conky starting too soon.

Click here for a full guide to Conky and how to write a script to run as a command.

Editing Commands

If you need to tweak a command because it doesn't run properly, click on the "Edit" button on the "Startup Applications Preferences" screen.

The screen that appears is the same as the one for the add new startup application screen.

The name, command and comment fields will already be populated. 

Amend the details as required and then press OK.

Prevent Applications Running At Startup

To remove an application which is set to run at startup, select the line within the "Startup Application Preferences" screen and click the "Remove" button.

As mentioned before it is not a good idea to get rid of the default items that weren't added by you.


More From Us