New on LowEndTalk? Please Register and read our Community Rules.
[Script] Install up to 10 Ghost blogs on Ubuntu or Debian
I created a bash script that can install up to 10 Ghost blogs on your own server, with Nginx and ModSecurity or Naxsi for better performance and security.
Setup is fully automated with minimal user input. A freshly installed Ubuntu LTS or Debian 8 VPS with at least 512MB RAM is required. Note: Maximum of 3 blogs on 512MB RAM.
I look forward to hearing your feedback/suggestion.
P.S. Also see my other repo Setup IPsec VPN.
Dumb question, but why "up to 3"?
Technically the script can be easily modified to support more than 3 blogs. Refer to my commit "Add support for multiple Ghost blogs". The files under conf/ will also need to modified with more blocks added. You are welcome to fork the repo and make the changes.
Considering that a 512MB VPS is almost running at full RAM for 3 Ghost blogs, I am keeping it at 3 maximum.
Edit: Now up to 10 blogs. See below.
Nice one, I installed ghost on a centminmod server with no issue.
The script has been further updated. Up to 10 blogs can now be installed on the same server. If you wish to use the updated script, you must start over with a freshly installed VPS.
If you are very adventurous and have a server with big RAM, it is possible to modify the "max_blogs" parameter to install even more blogs at your own risk. Note that each blog requires about 256MB of RAM.
Thanks man . I really like to see others effort shared to the community
A ModSecurity-related bug which only affects multiple Ghost blogs was reported on GitHub.
To work around this bug, please follow these instructions.
Are you sure this is a ghost blog? Because in my boxes it doesn't use more than 110mb ram
Yes it is. The 256MB RAM is just a very conservative estimation. The actual RAM usage may be less.
So rather than 3 blogs per 512mb ram we have a maximum of 6.
Notice that low vswap ram (openvz) may not work properly for node js
Technically you can. The problem is that a lot of RAM is required during the install process, specifically when running the "npm install --production" step.
On a 512MB VPS with multiple Ghost blogs, the above step will eat all available RAM and require swap in order to finish. Otherwise it gets "Killed" and leads to an incomplete install.
E: Version '0.12*' for 'nodejs' was not found
Error: Failed to install 'nodejs'.
Tested and the script is working fine. What OS are you using?
Ubuntu 14.04 x86 minimal
Thanks for the report. I have just updated the scripts to use the newer Node.js version 4. Please try to download and run the script again on a freshly installed Ubuntu system.
I am wondering if a ghost blog can be installed in a 256MB kvm box since it does not need much resources when running.
Does OP has any ideas?
Yes it is possible. A workaround is required though.
Step 1: Run the install script on a temporary server (DigitalOcean, etc.) with at least 512MB RAM.
Step 2: Run a modified version of the install script on your 256MB server, with the "RAM detection", "npm install" and "start Ghost/Nginx" lines commented out.
For ghost-nginx-modsecurity.sh, comment out lines 60~63, 255, 469~470.
For ghost-nginx-naxsi.sh, comment out lines 60~63, 255, 457~458.
Step 3: Stop Ghost blog on the 512MB server:
Step 4: Copy the "/ var / www / YOUR_DOMAIN_NAME" folder from the 512MB server to the 256MB server, using a .tar.gz archive. Be sure to first remove the existing folder on the 256MB server.
Step 5: Reboot your 256MB server and enjoy your new Ghost blog.