Jump to content

How to run two separate servers on the same vps on linux?


David

Recommended Posts

Been asking around on discord and nobody answers so I'll ask here:

 

I bought a vps to host a zomboid server for some friends and wanted to know if there was a way of hosting two servers on the same vps rather than just one.

Link to comment
Share on other sites

If you are going to host 2 or more servers on 1 ip address, you need to use port offset.
Let's say the first server is running on the standard port 16261+32 players (for example) then the second server should use 16294 and higher.
It is also probably necessary to reconfigure the steam ports.

For each server, you need to configure the path to the cache directory using the startup argument -cache dir="path"

 

(I use a translator sorry for the inaccuracies)

 

Link to comment
Share on other sites

15 hours ago, ProjectSky said:
./start-server.sh -port 12345 -servername test

 

This allows me to do it but I wonder why it overrides whatever I put into the ini file when it first generates.  It just recreates one from scratch it seems for me.  Is there a way to prevent this?

Edited by David
Link to comment
Share on other sites

5 hours ago, David said:

This allows me to do it but I wonder why it overrides whatever I put into the ini file when it first generates.  It just recreates one from scratch it seems for me.  Is there a way to prevent this?

not happened my server, did you do that after shutting down the server?

Link to comment
Share on other sites

6 hours ago, ProjectSky said:

not happened my server, did you do that after shutting down the server?

Before I made this thread, someone told me to use -servername to see if what I was asking for would work.  It did as it generated its own .ini and sandbox files to whatever I named it.  I assume that if the name already exists, it would just load from the settings under that name.  I changed the default port for this server in the ini file and made sure it saved before using -servername again however it simply overwrites whatever changes I made and everything is made default again, this also makes it give the error that the port is already in use because I already have a server running on default port so the server cannot start.  The -port flag seemed to stop it from changing the ini file and allowed it to start.

Link to comment
Share on other sites

If I were you, I would just split the server completely, as have it installed twice on separate folders. 

On top of that, they need to be using separate cache folders for the world save, world configuration, etc. 

Lastly, will just be a matter of using separate ports and that's it. 

 

Reusing the same server files for 2 instances of it running, just sounds as a horrible idea to me, as someone that is at the point of change things on the server on a code level. 

Link to comment
Share on other sites

  • 5 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...