LinuxGSM server ( ) is a  bunch of server scripts which allows you to simply run multiple game server on your Linux. It’s really awesome and if it supports your game I really recommend it to you.

The problem is that ProjectZomboid  allows to be bind only to 1 IP,  in this tutorial we will take a look at:

How make PZ LinuxGSM server available on all network interfaces.

Our problem is that we are running Project Zomboid server on a a machine which has 2 network interfaces ( 1x hamachi, 1x local network) problem is that free Hamachi supports only up to 5 computers. And if you bind the server to one IP it’s not accessible from the second one. We want to be able to connect to the server with both IPs.

We will take a look how we  can “fix” this using Nginx reverse proxy. Btw we could do it also using iptables or maybe some other way.
This tutorial can be applied in general on any game server but it describes Project Zomboid specific ports.

Please note that setting up the server ip as or doesn’t work.

First let’s take a look at our server IPs using command ip -4 address

[email protected]:/var/log/nginx# ip -4 address
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    inet scope host lo
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    inet brd scope global eth0
       valid_lft forever preferred_lft forever
4: ham0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1404 qdisc pfifo_fast state UNKNOWN group default qlen 1000
    inet brd scope global ham0
       valid_lft forever preferred_lft forever

As you can see our server is listening on 2 IPs, and , let’s select one and set it up as our “main” IP for the server.

Setup your main IP on your server

Edit your lgsm config file using your favorite editor vi or nano (location might be different)
vi /home/pzserver/lgsm/config-lgsm/pzserver/common.cfg

Change the config ip to your main IP:

## Server Start Settings |

parms="-ip ${ip} -adminpassword \"${adminpassword}\" -servername ${servicename}"

Restart your server using command ./pzserver restart

Check that you can connect to your server. So far this is basic settings. We haven’t done anything special.

Install NGINX

Just install NGINX server on your system. This guide is pretty nice:

Basically all you have to do is:

sudo apt-get update
sudo apt-get install nginx -y

Configure the NGINX proxy server

Edit the config file for the nginx which should be located at /etc/nginx/nginx.conf , you can leave the default settings there.

Now the PZ is using UDP port 16261 for server handshake. More info about ports here

We need to redirect this port from our second IP to the main one where the server is running.
Just add to the config this part:

stream {                                       
        server {                               
                listen udp;   

# PZ Guide is saying that it's necessary TCP but it's working without the redirect                                               
#       server {                               
#               listen;       
#               proxy_pass; 
#       }                                      

Note about TCP redirect. It might be necessary to redirect also TCP ports  but it’s working for me so far without it. If you run into problem check out the link describing the TCP.

Now just restart the nginx service service nginx restart


Now you should be able to access the server using both IPs

Btw note that if you changed the IP you will have to migrate the folder of your character located on your computer.

So copy the folder
(change the location based on your IPs and your usernames) 



Leave a Reply

Your email address will not be published. Required fields are marked *