I get Bad Gateway all the time. I follow the guide ghost has in the site exactly but I still have the same error.
I’m out of ideas on how to do it. Im not a command line expert. Can someone help me out?
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.
Click below to sign up and get $100 of credit to try our products over 60 days!
@makiomilano
Here’s a quick copy & paste that you can use from the command line that will take care of updating the OS, upgrading existing OS packages, installing Node.js, setting up a new unprivileged user, setting correct permissions & ownership on
/var/www/ghost
, updatingnpm
, installing PM2 (to allow Ghost to run without requiring the terminal be open), and finally, installing Ghost. It will then run Ghost asghostjs
(the created unprivileged user).This was just tested on Ubuntu 15.10 64-bit here at DigitalOcean on a 1GB Droplet. All you need to do is copy & paste the below to your favorite text editor.
For this to work, you’ll need to copy and paste the multi-command shown below and do a quick search and replace. Search for
DROPLETIP
and replace it with the IP address of your Droplet. Once you’ve replacedDROPLETIP
with your Droplet IP, simply paste it in to the CLI and hit enter.Please keep in mind, this is simply to get you going and will only allow you to access the Ghost installation by using the Droplet IP (though you can point your domain to the IP and use it instead).
If you need to further configure Ghost, you’ll need to navigate to
/var/www/ghost
(usingcd /var/www/ghost
) and edit theconfig.js
file (nano /var/www/ghost/config.js
).In regards to the question posed to @etel , if you use the pre-made option, you would deploy a new Droplet and then destroy the other. If you have an existing database, the above multi-command will help you get moving in the right direction without tampering with anything, though I would recommend running it on a fresh Droplet to ensure that anything you’ve done to your existing will not cause the commands above to fail.
Important Sidenote
Since you mention that you’ve not too familiar with the CLI, it’s worth noting that servers are not, by default, secure and server maintenance is a requirement, not an option. Failure to realize this often results in compromised servers which leads to data leaks and more often than not, data deletion.
VPS’s, Dedicated Servers and similar are nothing like shared hosting where the web hosting provider takes care of these things for you, so to truly benefit from the power and speed that more capable options provide, learning the command line and what it takes to properly secure, manage and optimize a web server beyond Ghost (firewalls, ssh, sftp, keys and numerous other things) is something I’d look in to and learn.
Have you tried creating your ghost blog from the 1-click image. Using that image will help you bypass a lot of the command line work associated with setting it up and should have the most recent version. You can find more info on the one click here.