I’m so sure this has been asked so many times before I’m sorry for asking once more but I really cannot find a question answering this:
I see that the official guide for production installation is very opinionated. That’s great, except for that I have an already running server and I’d like to use caddy. Is there absolutely no guide, no matter how open ended (even if it leaves the webserver configuration to me), for installing ghost other than with the prerequisites explained in https://docs.ghost.org/docs/install?
I tried going through with the installation (ghost install) expecting to get some errors (webserver) that I’d fix myself but it doesn’t seem to install anything.
I’m not sure if I should install it as if I were doing it locally?
An alternative from the official docs would be nice. After having used ghost for years it certainly feels like a “fuck you” to have to rely on unofficial docs… I’m still quite surprised there’s no alternative so please pardon me if I have missed it on the docs.
This seems to be your issue - when you run ghost install, it should ask you a series of questions which you fill out. If it’s not doing that, something’s not working properly.
While the CLI is really opinionated (for good reason), it does support you telling it to do something another way, or not doing it at all - docs ref
when I run ghost install it runs some checks of which the nginx one fails. It asks me if I want to go on with the installation, either by saying yes or no, it starts trying to isntall it but it returns the error “Checking operating system compatibility” “System stack checks failed with message: ‘Missing package(s): nginx’”. And stops. The folder is empty.
Thanks for the links, it looks like I might be able to install it using the setup options. However, at first sight, I’m still not sure of which command will install the ghost files on my server, it looks like all those setup commans are focused on the specific configs with the database, the webserver, etc…
thank you :P, I obviously went through that post before coming here, and besides it’s not official, it uses docker so it seems to download the ghost files from some specific docker with
It sounds dumb but I have no problem setting up caddy, it’s just that I don’t know where am I supposed to get the ghost files from! Maybe I just need to clone the project from github heheh
I kind of asked here as feedback on the fact that it can be a bit confusing how to proceed if you don’t go with the specific requisites hehe
I managed to install ghost now. In theory it’s running at 127.0.0.1:2368 but if I set caddy to reverse proxy to that, when accessing my domain I get a “Cannot GET /” Error. From ghost ls I take it that the cli makes it run in the background and so I don’t need to use pm2/forever anymore… got any clues of what might be wrong? It’s funny that the whole setup thing is supposed to make it easier…it’s making it 10x more complex to me haha
That’s correct! The CLI is pluggable, so if you find an extension for a process manager, you can use it, but the default is systemd integration
Hmm, can you run curl http://127.0.0.1:2368 -I to make sure the Ghost instance is responding? If it works, then there’s an issue with your caddy config, and I’m not well-versed in caddy, so I can’t help
Hopefully you’ll find the update process to be 10x easier The CLI works well, but it is definitely a WIP
Edit: you don’t necessarily need to use curl to make sure your instance is up, but I suggested it because it ensures that the entire chain of events is functional. You can also use netstat (sudo netstat -tulnp) to make sure ghost is active and listening on the correct port.
So I installed ghost with --no-setup-nginx since I want to use caddy.
If I run ghost ls, I see ghost is running on port 2368.
I configured caddy, and when accessing my domain I get a “Cannot GET /”. When I run a “lsof -i :2368” on my server, nothing appears. Does this mean ghost is not running on the port it says it’s running?
I’m quite sure that caddy is working right since I tried the configuration with another app, I am basically pointing https://blog.everyday.app to 127.0.0.1:2368 with it. I’m not sure what may be wrong, I installed “n” to be able to install node 6.9.0 for ghost, and so I reinstalled node 10.6.0 with n for my other apps, I’m not sure if this could be adding confusion to the ghost cli?
Just ran some tests on one of my production instances - did you configure your blog to run on a subdirectory? i.e. my.blog/SUBDIR? The instance I tested with returns the same response (headers + 404) when requesting /, but returns the proper headers when requesting /blog, since it’s configured to run on a subdirectory.
Edit: I forgot ghost ls outputs the url - could you try restarting ghost (ghost restart) to see if that helps?
I uninstalled ghost and started the whole process from 0 (now that I had learnt a few things) and it worked straight away. Thanks for all the help Vikas! Might write a blog post to help future users
If anyone is looking to run Ghost in a Docker container, here is the setup I use in production. Just execute runup.sh bash script and you are good to go. This setup also allows you to run your blog under mysite.com/blog.
Ensure you have Docker installed on your server. To update your Ghost container, just stop the container and execute to runup.sh again. Hope it helps :)