Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

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

Where is the conventionally accepted location of node.js/express web apps, in a linux file system?

Currently I've got a subdirectory in /opt/ but I'd like to hear other people's view on this...

share|improve this question

The /opt directory is a good location for the program distribution files. The /srv directory is used for the programs run-time data. (Please see the Filesystem Hierarchy Standard.) Unlike the /etc directory where the standard indicates that the /opt/<pkg> configuration files should be placed in /etc/opt/<pkg>, there is no standardization that /srv/opt/<pkg> should be a parallel structure (although it's probably not a bad idea).

In summary:

/opt/webserver/     (your node.js application)

    config.json     (configuration file for your web server)

/srv/opt/webserver/ (opt subdirectory suggested, but not required)


Please keep in mind that this is the general case, and is not unique to express applicaitons.

Hope that helps,


share|improve this answer
Why did you recommend to put logs into /var/opt/webserver and not into /var/log/webserver? Is this a typo? – kaiser Feb 19 at 12:39

The most appropriate place would be under /srv.

share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.