 <p>Your approach is ok, but you can make something more generic, like storing the config data for Redis in a file or passing the host and port like arguments:</p> <p><code>node app.js REDIS_HOST REDIS_PORT</code></p> <p>Then in your app you can grab them using process.argv:</p> <pre><code>app.configure('development', function(){ app.use(express.errorHandler({ dumpExceptions: true, showStack: true })); var r = require("redis").createClient(process.argv[2], process.argv[3]); }); app.configure('production', function(){ app.use(express.errorHandler()); var r = require("redis").createClient(process.argv[2], process.argv[3], { detect_buffers: true }); }); </code></pre> <p>Update:</p> <p>Express will know in what environment you're in by looking at the NODE_ENV variable (process.env.NODE_ENV): <a href="https://github.com/visionmedia/express/blob/master/lib/application.js#L55">https://github.com/visionmedia/express/blob/master/lib/application.js#L55</a></p> <p>You can set that variable when starting the app like so: <code>NODE_ENV=production node app.js</code> (recommended), setting process.env.NODE_ENV manually in your node app before the Express code or putting that env var in ~/.profile like Ricardo said.</p>