Installing Second Ghost Instance on Single VPS


#2

Hey!

I’m running multiple instances of Ghost on the same VPS and the installation and configuration process is identical.

The only thing that changes is the port on which Ghost is listening to, i.e.

But yeah, I don’t remember it being well described in the Ghost documentation, I remember figuring this out from other sources.

Indeed, in theory is an nginx config thingie, but I think this use case should be described in the Ghost documentation as well.

Hope this helps!


#3

Forgive my ignorance: Do I have to install another instance of Ghost too, or do I just set up another nginx config?

Michael


#4

Yes, in the directory, create a new folder instead of www (if you used the default), and do another Ghost config in the new directory.


#5

Yes, just install another instance of Ghost in the directory of the second site and adjust its nginx config to match the new install port number.


#6

You don’t need to adjust the nginx config. Installing a second instance should be the same difficulty as installing your first instance (the CLI finds the next open port if 2368 is taken)


#7

It highly depends if you only run Ghost on that server or other websites as well (I, for example, run multiple websites on the same server, some with php-fpm). If your nginx config listens on the default ports of 80 and 443 you need to tell it to proxy to the different Ghost ports in order for the Ghost installs to be available to the world wide web (also if you manually config the nginx).


#8

In this case, there’s nothing to worry about, since everything is on its own subdomain :wink:

  • whenimbetter gets its own config supplied by ghost (with the port set to thewhenimbetter instance)
  • mj94 gets its custom config
  • blog.mj94 gets its own config supplied by ghost (with the port set to the blog.mj94 instance)

#9

Could be that easy :slight_smile:, but I didn’t dare let Ghost set up my nginx (was afraid it might want to treat it as a single site installation) so I worked with manual configurations.

Also, I had issues with the user setup as well :slight_smile: as I run nginx under an nginx user and I had to setup Ghost under a different (sudo) user and this made me have the Ghost installation folders with different ownership as compared to the other websites (which were all under nginx user).


#10

Wait a minute, so I didn’t even need to update my MJ94 nginx config file?

Here’s what I have so far:

  1. The nginx file for my fully functional WIB blog.
  2. A database for the WIB blog.
  3. The current nginx file for mj94.net.
  4. A database for the MJ94 blog.

I tried following the directions here and here, but I didn’t want to mess anything up (but yes, I do have backups).

I also have the existing config files for the WIB which I copied and modified for the MJ94 blog.

So, what you’re saying, @vikaspotluri123, is I shouldn’t worry about the config? I should just install a new Ghost instance in the same place I installed it for WIB?


#11

That’s right, you shouldn’t need to edit any nginx configuration files, if you trust the CLI :wink:

Assuming you have your current blog instance at /var/www/blog-whenimbetter/ghost, following that name scheme, you need to create an empty directory at /var/www/blog-mj94/ghost and run ghost install in that directory - everything will be setup for you, similar to how whenimbetter was setup.

It looks like you copied blog-whenimbetter to blog-mj94 - you don’t want to do this since this would copy whenimbetter-specific configuration over to mj94.

With regards to configuration, the reason you don’t need to modify nginx is because you’re serving (in the eyes of nginx) from 3 separate domains. If you were to serve this new instance from (for example) mj94.net/blog, you would need to modify the nginx configuration manually, because of the way nginx configuration works - you can’t configure the same domain multiple times (and subdomains are not the same thing as domains)


#12

Great, thank you! Thanks for confirming that before I did it; I appreciate your help.

Right, that’s what I assumed—I was planning to manually configure it for the MJ94 blog, but your way (in theory) sounds easier.

I successfully installed it again, but realized in doing so, I broke my WIB install. WIB’s original install location was /var/www/ghost. By moving it to /var/www/blog-whenimbetter/ghost, I break subpages/links.

Is there a way I can properly move WIB’s /var/www/ghost to /var/www/blog-whenimbetter/ghost so that I can separate the two installs once MJ94 Blog is installed in /var/www/blog-mj94/ghost?

Once I’m able to seperate the two in their respective folders, I’ll be set to go! :slight_smile:


#13

I don’t know of an easy way to do this - The cli currently symlinks system files (see #469) so moving the installation directory would break those links.


#14

So, there’s really no way to install a second instance of Ghost? Because it seems to just overwrite my existing WIB installation when I try.


#15

You can install a second instance of ghost! I’m just not sure of an easy way to move an installation folder from one location to another


#16

My current functional blog is located in /var/www/ghost. Where would I install a new instance of Ghost to be able to have a second blog?

I can’t move the folders to separate the two, and when I try to install a second instance in /var/www/ghost, I’m told that because the current directory isn’t empty (because WIB’s Ghost is there), I can’t install another instance.

Basically, what I’m asking is: since we can’t move the files, where can I install a separate instance of Ghost that will work independently of my first and won’t overwrite it? :slight_smile:

Thank you for any clarification!
Michael


#17

You can install it anywhere, such as /var/www/mj94-blog. Just note that once you pick the folder, you might want to stay with it :wink:


#18

Thanks! Everything worked great. I may even reinstall my first blog and move it to ~/whenimbetter.com/blog, just so it’s a part of the same naming scheme as my new one at ~/mj94.net/blog, but that’s a project for another day.

Once I installed Ghost, created a new nginx config file, and set up Certbot, all was well!

I hope you all have a great day! :smiley:

Michael


#19

Pretty awesome, isn’t it?


#20

I love it. Again, thank you all!


#21

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.