Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What is the 'correct' location(s) to install packages/software in a Unix file system? I realize it will vary somewhat depending on the distribution you're using and the package you're installing, but I can't seem to find any tutorials that aid in deciding where it makes sense to install something.

For example, I'm currently trying to get a Ubuntu server up and running. I'm would like to install a variety of things (mysql, mercurial, ruby on rails, radiant), and I can find plenty of tutorials that say to "install in /pick/your/directory", but nothing that seems to say what the logical choice for '/pick/your/directory' would be or how to go about deciding what '/pick/your/directory' should be (if there is no universal location).

share|improve this question

It's rather complicated. On ubuntu, I'd install as much as possible from apt, rather than compiling your own. If you do need to compile your own, the general Unix guidelines are here, and Ubuntu follows debian packaging guidelines, which can be found here.

share|improve this answer
I agree. Your best bet is to use the packaged version if one exists. I only install manually if there's no deb package or I need a bleeding edge version. Easy updates and uninstalls are well worth having a slightly older version (assuming you have the functionality you need.) – Chris Nava Sep 7 '09 at 23:37

For things like mysql etc. you should really consider installing using the ubuntu packages via apt. This makes it much easier to manage upgrades. The system packages will decide the correct locations to be installed.

If you do want/need to compile/install your own stuff manually then the correct place to do this on debian/ubuntu systems is /usr/local. The debian packaging rules specifically reserve /usr/local for software manually installed manually by the system admin.

share|improve this answer


For Ubuntu server I'd highly recommend using apt-get:

To install a package:

sudo apt-get install packageName

To remove a package:

sudo apt-get remove packageName

apt-get will install the packages in the default directories they were intended for. This will help when you're reading the documentation and see examples in specific paths.

You might also want to look up additional apt-get commands such as "update" and "upgrade".

Roll your own

Installing the packages manually or compiling from source is a bit more difficult but just the same... take a look at the documentation and see if you can figure out where the software designers "intended" the package to go. Most of the time you can figure it out from the docs. If not, a quick Google search will usually show where "most" people put their packages.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.