i am trying to install Ghost on Ubuntu 22.04 running in AWS EC2. I am following the ghost.org installation instructions for Ubuntu. I have tried this twice now with fresh servers. When I get to the point of Ghost Install"", it hangs up here "Downloading and installing Ghost v5.72.1 > Installing dependencies > [4/5] " I have let it sit for up to 15 minutes and eventually the terminal activity stops.
Any help much appreciated! Thanks
Ok, additional info, I left the installation alone for an hour, and when I returned my ssh session was frozen. I could not logon using SSH again, even after rebooting. Using the AWS console I was able to logon using session manager, which does not use ssh. I ran ghost doctor and it returned the following:
su - gadmin
gadmin@ip-172-31-35-153:~$ cd /var/www/blog
gadmin@ip-172-31-35-153:/var/www/blog$ ghost doctor
Working directory is not a recognisable Ghost installation.
ghost doctor again within a folder where Ghost was installed with Ghost-CLI.
gadmin@ip-172-31-35-153:/var/www/blog$ ls -l
drwxrwxr-x 11 gadmin gadmin 4096 Nov 8 16:29 content
drwxrwxr-x 3 gadmin gadmin 4096 Nov 8 16:29 versions
Try again while connected to the server in a second window running htop.
See if you are running out of memory or CPU during install.
You didn’t mention the specs of your server.
Thank you very much, this makes sense, and now that you mention it I recall reading something about this issue before, and I am using AWS EC2 micro which is only 1 GB RAM. But since I installed and ran Wordpress successfully I didn’t think about it. I have since moved on to another CMS but if it does not work out I’ll try this again. I believe that I could bump up the server specs for the install and likely return to the micro config, for the AWS free tier, after a successful install. I do not expect my website to have much traffic. Thank you very much!
Someone else got Ghost to run on an instance with 1GB of ram and published a blog post and source code to help others do it:
I took a closer look at this and it’s actually a script for updating Ghost rather than installing it. And unfortunately there is no info that would help with a fresh install. I am not too happy with the other CMS that I have successfully installed so I want to try Ghost again. The official minimum requirements for Ubuntu is 1 GB RAM, and no minimum for CPU is given. So the AWS micro does have 1 GB RAM so theoretically it should work. So if I get to the point of having the same issue again I’ll run htop and see what’s happening. I will keep updating this thread. Thank you.
I started htop and noted that the MEM usage was 450/950 and very little CPU. I started the install and the MEM eventually went up to 800/950. However the CPU was consistently spiking above 90%. I do not know how to use htop but it looked like mysql was using most of the resources. After watching for about 15 minutes I left for lunch and when I returned the terminal running htop had lost it’s connection, and I noticed the CPU was at 99.1 % when it stopped. I was able to quit the hung Ghost install with ctrl c. I reopened htop and the resources back down. I viewed the root directory and it has two folders, content and versions. Is there an installation log?
So I am not sure but it looks tome like the issue is CPU. The MEM stayed at 800/950 the whole time the install was running. I am not sure if there is a way to get Ghost installed on this free tier instance of Ubuntu. I am on a tight budget otherwise I would up the instance to something with more resources. I am also going to post this on the AWS forums and see what they have to say. But if anyone has advice for me it will be much appreciated.
I run a few VMs with 2G that have several Ghost blogs, a couple of Wikis, PIWIGO, static websites, some node/express sites, git hosting etc, all on the same VM and they work fine for medium to low traffic sites.
Top shows that the biggest memory user by an order of magnitude is the MySQL service. In my experience, while MySQL can be squeezed into 512MB or 1G, at 2G or more it works well with other services on the same host.
As an illustration, on a 4G VM running several blogs:
- MySQL has virt 1.6G, res 1G using 26% of memory
- Node has virt 1G, res 200M, using 6% (x 9 instances)
- Ghost has virt 600M, res 36M, using 1% (x 9 instances)
- Nginx has virt 23M, res 11M, using 0.3% (x 6 instances)
I have 9 instances of Ghost on this VM, along with NGINX and several PHP sites.
If you are using a dedicated VM for a single blog, I would expect that this would easily fit into 1G RAM - though I would make sure you have some swap for process start-up.
Thank you. The problem is only with the Ghost-cli installer. I imagine if I get past the install it would be fine. Nothing else running on this machine
I discovered my Amazon EC2 instance was probably throttling cpu due to the way that configuration allocated burstable cpu, however I enabled “unlimited” so the cpu could run at capacity as much as necessary. I ran both Ghost uninstall and Ghost doctor, but neither recognized the directory as a Ghost install so they would not run. I deleted the contents and ran Ghost Install again. This time the installation went a little further to “5/5 bundling fresh packages” before the server became cpu bound at 100%. I was unable to filter htop to verify exactly what processes were taking all the cpu. The MEM utilization held at around 800/950.
I did verify the the vcpu is Intel(R) Xeon(R) CPU E5-2676 v3 @ 2.40GHz.
So the question now is, shouldn’t this processor be sufficient to install Ghost?
I seems to me that something else is going on, and I suspect it has to do with node.js, but since I am no Linux expert it is just a guess after Googling “node.js cpu” and seeing issues.
I am not sure what to do next, maybe try installing on a different server like the “Amazon Linux” or something, just to see. Since I am an IT pro I feel like the gauntlet has been thrown down and I have to solve this LOL!
I added 1G of swap and the install completed rather quickly. Apparently the default EC2 images do not include a swap partition, I should have saw that earlier. Thanks everyone for all the support!