Jump to content

Ubuntu Setup Guide


Chained_Phoenix

Recommended Posts

Well after stuffing around and starting over many many many times I've finally got a full step by step guide for installing steamcmd and Project Zomboid Dedicated Server (Steam version).

 

I did this with-in a container (Container Station on a QNAP NAS) but it should work the same everywhere:

Basic Ubuntu setup, I'm using version 18.04, each of the steps will be a command to run and a bit below it to explain any additional things to do:

 

Step 1: dpkg --add-architecture i386

 

Step 2: apt-get update

 

Step 3: apt-get upgrade

 

Step 4: apt-get install nano

 

Step 5: apt-get install dnsmasq

 

Step 6: apt-get install resolvconf

 

Step 7: apt-get install lib32gcc1

 

Step 8: apt-get install steamcmd

 

Step 9: apt-get install --reinstall ca-certificates


Step 10: nano /etc/dnsmasq.conf

^This will open up the file, find the line "#listen-address=", remove the # in front of it and added in "127.0.0.1" minus quotes then save the file (Ctrl+x, y, enter).

 

Step 11: service dnsmasq restart

 

Step 12: service resolvconf restart

^Steps 5, 6, 10, 11, and 12 are to fix the slow download speed issue with steamCMD (as Valve are too lazy to fix it).  If resolvconf gives an error like "Warning: /etc/resolv.conf is not a symbolic link to /run/resolvconf/resolv.conf" you have to manually get each file to point to 127.0.0.1 (they may oddly be pointing to 127.0.0.11).  I haven't ironed this section out yet but steam resumes from where you cancel it if the download is going super slow so jump out and try restarting the services again.

 

Step 13: cd /usr/lib/games

 

Step 14: ./steamcmd.sh

^ Allow it to update, if it doesn't load, reboot your container/OS and start from step 14 again.
Once in steam:

Step 15: login ***USER_NAME***
^ Replace ***USER_NAME*** with your Steam username.  It will then ask for your Steam password (it can be a bit slow after each thing you type in but just wait, it is working) and then Steam-Guard if you use two step authentication.

 

Step 16: force_install_dir ./pz/
^ Change "./pz/" to whatever directory you want if you care that much

Step 17: app_update 380870 validate

^ This should be pretty quick depending on your internet speed, if it's SUPER slow, Ctrl+C to cancel and try doing a few of the DNS fix steps above (reboot, 5/6/10/11/12).

 

Step 18: cd /usr/lib/games/pz

 

Step 19: ./start-server.sh

^ This should then load and create all the other bits you need, it will ask you for a password (please note it types on the screen in plain text so you may not want someone behind you) and then be good.  I recommend testing connecting to it, then quitting so you can change settings.

 

Step 20: cd /root/Zomboid/Server

 

Step 21: nano servertest.ini

^ I'll add a comment below this once I've finished writing it up with my recommended settings and how to add mods.

 

 

 

 

Link to comment
Share on other sites

Additional things you may want to do:

 

You can run the server and steamcmd from a user you create for that purpose.  It's recommended to do this security wise but for me this is a container (virtual box) and even full admin rights all you could do is break the container it doesn't really make any difference for me.

To make the user, throw these lines in after Step 12:

 

Step 12b: adduser steam

 

Step 12c: su - steam

 

Then continue as that user for the other steps.  You make want to install Steam to with-in the users home folder though so make sure you select that as your install location.

Link to comment
Share on other sites

  • 4 weeks later...

My brother and I spent hours trying to get a server up. We got the server running, but couldn't connect to it. The server log would say "znet: OnP2PSessionConnectFail: 4".

 

We eventually got it to work by disabling steam on the server and client.

 

On the server in the ProjectZomboid64.json file, I set "-Dzomboid.steam=1" to "-Dzomboid.steam=0", then when the server started up it would say steam is not enabled.

 

For the client, we just added -nosteam to the launch options in steam.

 

Hopefully this saves others some frustration in the future.

 

EDIT: Also, fyi, we used linuxgsm to install the server and run it. https://linuxgsm.com/lgsm/pzserver/

It has a few typos but is pretty useful.

Ubuntu Server 16.04 64bit on Digital Ocean

 

EDIT2: Mods won't install without steam being enabled on the server :(

We're turning on steam on the server and it's downloading mods from workshop, we'll see if the client will be able to download them or what.

We're using the Mods property in the server ini file, semi-colon seperated list of Mod Ids (ex: Hydrocraft;Othermod)

 

EDIT3: SOLVED:

 

Got it! Digital Ocean servers have an anchor ip configured and that somehow messes with the zomboid server. Deleting the anchor ip resolves the issue (allows me to run server with steam enabled and mods).

 

For anyone with this issue in the future:

 

  1. Find out your server's anchor ip

    curl -s http://169.254.169.254/metadata/v1/interfaces/public/0/anchor_ipv4/address
    
  2. Confirm that the anchor ip exists:

    ip addr list
    
  3. Delete your anchor ip

    ip addr delete <anchor ip + mask> dev eth0
    
    example: ip addr delete 10.46.0.6/16 dev eth0
    
  4. Confirm that anchor ip is deleted

    ip addr list
    

Should be good to go after that!

Edited by AdenFlorian
Link to comment
Share on other sites

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...