Applications are started by executable files, i.e., binary executable or scripts that have the executable bit set. Who can start the executable is determined by the permissions set on the file.
Some applications are contained in a single stand alone . You can just execute the executable wherever it resides on the file system, and the program will run successfully.
Other applications are more complex. In order to successfully run, libraries and other files they need need to be installed in specific locations. When you use the Ubuntu software center or apt
on the command line, this is automatically performed through installation scripts contained in the .deb
installation file.
By default no applications run as system root. Whether the application is a system wide installed application, or a single executable in your home folder, when you start it up, it will not run as system root. It will run as a process of the user who launched it. The administrator needs to specifically set it up if an application must run as root.
Formerly, some graphical applications were run as root. That is still the case with for example "Synaptic Package Manager". However, current trend is to never run a graphical application as root, and rather spawn processes as root only for specific actions. The application "Disks" is an example of this more modern approach. Only when you are about to do something that needs root permissions will the application ask your password, and only then launch the processes needed to carry out the task, e.g., formatting a drive.
If I install an application is it installed on system root (administrator on windows) and can be access to all?
If the system administrator decides so, then yes. In other words, this is not a general rule. However, most commonly, applications are there to be used by users. So the administrator (system root) installs them in system folders in a way that they can be started by all users.
second question is about "not running it on root system". If question no 1 is true and I should not run it on root system then I just need to create a new user and give permission to the application and run it from that user, is this correct?
If you wish to restrict applications to specific users only, then indeed you can set that up. You do not need creating a new user. You rather need to configure the application this way that it can only be run by that specific user. One way is to install that application in a directory under the home folder of that particular user, so it will not be visible nor accessible - depending on the permissions - by other users.