Got myself into a problem trying to install Ghost 0.4.2 on a Digital Ocean Droplet with node 0.10. I used the Dokku Droplet (instead of their Ghost setup) because I'd like to install multiple node apps with different domains.

I git cloned the stable Ghost release and followed the instructions they gave to set it up:

npm install -g grunt-cli
npm install
grunt init (and grunt prod if you want to run Ghost in production mode)
npm start

I've changed my config.js file (the production part) to

    url: 'http://mydomain.co',  
    mail: {},
    database: {
        client: 'sqlite3',
        connection: {
            filename: path.join(__dirname, '/content/data/ghost.db')
        debug: false
    server: {
        // Host to be passed to node's `net.Server#listen()`
        host: '',
        // Port to be passed to node's `net.Server#listen()`, for iisnode set this to `process.env.PORT`
        port: '2368'

When I use port 2368, it says that "Ghost is running... Your blog is now available on http://mydomain.co"

But then it gives me a nginx 502 error on the page.

Ok, when I change the production port to 80 (one article suggested this), it throws this error:

        throw er; // Unhandled 'error' event
Error: listen EADDRINUSE
    at errnoException (net.js:901:11)
    at Server._listen2 (net.js:1039:14)
    at listen (net.js:1061:10)
    at net.js:1143:9
    at dns.js:72:18
    at process._tickDomainCallback (node.js:459:13)
    at process._tickFromSpinner (node.js:390:15)
npm ERR! weird error 8
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read

I'm guessing this means that port is already in use.

How do I setup the correct port?

Ok, so here's another part I don't understand. Many sites mention trying "sudo service ghost restart". I always get "ghost: unrecognized service" to this. It's odd because everything is in place and the developer instructions they gave (see the top of this) worked well for installing it. But my system doesn't know it's there.

Also, there doesn't seem to be any /var/www/ghost file. Not sure what that means.

I've sleuthed and googled but can't seem to figure this out. Any hints or tips would be so appreciated.


this is in my ghost config.js file

server: {
        // Host to be passed to node's `net.Server#listen()`
        host: '',
        // Port to be passed to node's `net.Server#listen()`, for iisnode set this to `process.env.PORT`
        port: '2368'

I see that your host is set to

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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