How to run applications at startup on Ubuntu 18.04

Startup applications are the programs that are launched automatically when Ubuntu boots up. Sometimes you want to make an application start after you log in to the system, like for instancea chat app or fan controller app, etc..
It could be also the case when the number of applications or services at startup becomes high that the system starts to slow down or show signs of sluggishness. In such situations, you may want to remove some of these automatically started programs in order to free up the system resources.
In this short article, you will learn how to execute a program at startup and how to prevent applications from launching automatically once the system boots up.

Startup applications management

Ubuntu has already a tool to manage Startup Applications .In order to open it, go to Dash and look up the word “Start ”as shown below :

Read: How to solve Busybox Initramfs error on Ubuntu

Once the shortcut appears, Now, click on it. This will bring up the window below :

Ubuntu startup applications 

To add a new application, simply hit the Add button and insert in the command field your program name in order to run the application. To know which command corresponds to your desired program, refer to the following section.

Ubuntu 18.04 run script on startup

Read: How to list, start and stop services at boot time in Linux Ubuntu/Debian

How to find the command to run an application?

To find the correct command that calls your application proceed as follows :

1 – Open the folder /usr/share/applications :

Right click on your desired application icon and select Properties :

This will bring up a small popup in which you can find the required command :

Once you know the command, copy it and go back again to the prompt window of the previous section, .i.e.

Ubuntu startup applications command line

Now in the Command field, paste the command value. You may want also to enter a name and a description. Finally, click on on Add button. Now in the next boot up, your selected application will be automatically launched at boot up.

Remove startup applications in Ubuntu

To remove a program from startup applications preferences, select it and then click on Remove button. :

Ubuntu startup applications

The program will not launch automatically at each start-up. Note that this will not uninstall the program.

Read: How to shut down, restart, suspend and hibernate Linux

Delaying a program launch at boot

To delay the launch of your chosen application proceed as follows :

1 In case your application already starts at boot, open up the startup application preferences window

2 Select the application

3 Hit the edit button

4 Put the cursor on the command field and add ‘sleep n’ right at the start of the command. This will delay the launch of the program by n seconds. See example below :

Ubuntu startup script

Now save and quit. This will take effect at the next boot.

Hidden startup programs display

To see the services that are launched at startup, open up a terminal and run the command below:

sudo sed -i ‘s/NoDisplay=true/NoDisplay=false/g’ /etc/xdg/autostart var wpcf7 = {"apiSettings":{"root":"https:\/\/net2.com\/wp-json\/contact-form-7\/v1","namespace":"contact-form-7\/v1"},"cached":"1"};