I’ve read a few posts on this subject, but I just updated my ghost using the DO-specific guide and it came up with a 502 error. I followed a couple of questions on how and why this is happening, including debugging it by turning nginx off and then running npm start --production inside my ghost folder. This worked fine, I then restarted nginx and ran the command again and my blog came back up. Problem is that naturally, this will stop working when I close down that terminal window/want to do anything else in the same terminal window, but when I close it and use “service ghost start” or “service ghost restart” I get a 502 bad gateway again. Help? Should note my original install was a DO one-click.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
What port is Ghost running on? Nginx listens for it on 2368.
The Upstart init script used on the “one-click” droplet essentially just runs npm start --production Here’s a copy of if:
description "Ghost: Just a blogging platform"
start on (local-filesystems and net-device-up IFACE=eth0)
stop on runlevel [!12345]
# If the process quits unexpectedly trigger a respawn
respawn
setuid ghost
setgid ghost
env NODE_ENV=production
chdir /var/www/ghost
exec /usr/local/bin/npm start --production
pre-stop exec /usr/local/bin/npm stop --production
Are there any errors in /var/log/upstart/ghost.log ?
This comment has been deleted
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.
