Connall Posted February 18, 2014 Share Posted February 18, 2014 YOU DON'T NEED TO DO THIS ANYMORE YOU CAN RENT A READY TO GO SERVER. LIST HERE: http://theindiestone.com/forums/index.php/topic/9856-project-zomboid-server-hoster-sites/ AUTO-INSTALL SCRIPTS NOW AVAILABLE: http://theindiestone.com/forums/index.php/topic/7504-linux-server-auto-install-project-zomboid-scripts/ Hey there, so I’m writing this guide as an attempt to help people who might be setting up their servers on a Linux server (such as a VPS) yet are relatively new to the entire game of server hosting. I’m going to be pretty in depth in this tutorial, however I will gloss over a couple of sensitive subjects. I’ll point you in the right direction for everything. Buying A Server So first off if you don’t own a VPS, you’re going to want to buy one. You technically have two choices, a VPS or a proper dedicated server. However… eh… You won’t be buying the dedicated server. Trust me. Unless you have an insanely popular server, not only is it expensive it’s a bit overkill all considering. There are plenty of places to get a VPS but there’s not a lot of places that allow game servers. This is the most important thing you must check before purchasing a VPS. While I know people usually don’t care about Terms & Conditions, you MUST read them. You can usually just CTRL + F “Game” or “Game Server” and you will swiftly find out whether they allow a game server or not. Rule of thumb for me usually is, the cheaper server providers usually don’t allow game servers since they draw too much resources. Don’t be fooled by pricepoint though, just because they are expensive doesn’t mean they allow game servers either. Your best bet will usually be buying from a provider that is specifically catered to gaming. I bought from NFOServers and I’m pretty happy with it so far, everybody has their preferences and different experiences, so just make sure to do the research. Regarding system settings, bandwidth wise I got about 3TB to work with and from the projections I might break 1TB by the end of the month, but I really doubt it. From indications around the forums my guess is the bottleneck would come down to RAM as that seems to be dictating how many players are able to get in. So take that into account. As for CPU I’m not entirely sure right now as to what is best and what isn’t. When ordering the server you’re going to want to make sure that there are linux OS’es available to install. This guide is geared towards those running a Debian (Wheezy) but the differences to this and Ubuntu should be minimal. Do not install Debian 6, the minimum if you install a Debian OS is Debian 7. Base Server Setup For the most part the provider should configure the OS and passwords and what not. So that shouldn’t be a problem. You’re provider will most likely provide a very random looking password for a user called “root” Now something we should have probably covered earlier. You’re going to want to download a program called PuTTY http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html(Just download PuTTY, nothing else.) This is the program we will use to access the terminal side of the server. This is basically the main way in which you will interact with the server. You can sometimes get an equivalent in the server providers control panel, however I believe it’s best to use this. Another handy little thing you might want to think about getting is FileZilla https://filezilla-project.org/ IMPORTANT: DO NOT USE QUICKCONNECT WHEN USING FILEZILLA, GO THROUGH "Site Manager" AND CHOOSE SFTP RATHER THAN FTP FOR PROTOCOL. FAILURE TO FOLLOW THIS RULE WILL LEAD TO REFUSAL OF SERVER CONNECTION This allows you to access the file side of your server which will be handy later on when we start mucking around with databases and server options. it’s an easy way to navigate the folders without using the terminal program. Anyway, open up PuTTY and in “Host Name (or IP address)” put the server IP that should have been provided by the server provider. Leave the port as it is. Leave the connection type as what it’s set at (should be SSH) then click open. You can save the session if you don’t want to input this info all the time. Just name it in saved sessions and click save. When you first connect it you’ll see “login as:” type “root” and hit enter. Next it will ask for the password, so provide the one that was provided for the server (not your control panel password) when typing it will look like you’re not entering anything, but I guarantee that you are typing something. You can paste the password as well by copying the password and just right clicking in PuTTY (CTRL + V isn’t set as paste, it’s right click by default. Have fun with that.) so now you should be in. Now there are a couple things you're going to want to do if it’s your first VPS. Certain security features you might want to think about installing and what not. You can google “First VPS setup Debian” or something along that lines if you’re really interested. Strictly speaking you can skip this part, but it’s your call. First thing you will want to type is these two:apt-get install default-jdkapt-get install screenThe first is basically installing Java while the second one I will explain in due course. Now we need to grab the Steam CMD so we can download the actual Project Zomboid software. It’s recommended that you run SteamCMD on a seperate user. You should add a new user by doing:adduser steamOnce that’s sorted we need to switch over to the new user. It should be noted anytime I refer to “steam” in the file directory context, then it means the user folder. If you decide to name the user something else the directories change also. Something to keep note of. “Steam” is not the same as “steam” in the directory context as well.su - steamthis will switch the user from root, to steam. We are going to create a steamcmd directory to keep things tidy.mkdir steamcmdcd /home/steam/steamcmdNow we need to actually get the SteamCMD. To do this we run this command:wget http://media.steampowered.com/installer/steamcmd_linux.tar.gzIt should eventually download and once it does we need to actually get the contents out of the folder. To do this we runtar -xvzf steamcmd_linux.tar.gzIf you're running a 64 bit version of the OS then the code in the spoiler applies to you. Otherwise, ignore. apt-get install lib32gcc1 Now we got to run SteamCMD To do this we can do:cd /home/steam/steamcmdthen./steamcmd.sh +login steamusername steampassword +force_install_dir directory/you/want/to/install/to* +app_update 108600" validate +exitWARNING You can choose to opt your server onto the beta branch instead, after running the above command run this:"app_update 108600 -beta iwillbackupmysave -betapassword iaccepttheconsequences" validate +exitKeep in mind that not all players will be using the beta branch so not everyone would be able to connect. The decision is of course yours. For login you will get a steam guard e-mail as should be expected, unfortunately you need the game in order to get the server software, so trying to log in as anonymous for SteamCMD will not work. *I can’t remember where I installed it to and whether I created the Steam folder or if SteamCMD did it itself. I personally installed it in /home/steam/ I think, but I honestly can’t quite remember. This is where FileZilla comes in handy, as now what we want to do is navigate to the project zomboid folder which should be something like /Steam/SteamApps/common/ProjectZomboid. Check this folder, does it have projectzomboid.sh? Does it have the projectzomboid folder? Does it have only these two things? Then sigh. You don’t have all the files. When you download the program you need to have the projectzomboid folder, projectzomboid-dedi-server.sh file and a projectzomboid.sh file. If you are missing the server file then you are missing one of the most important things. You’ll have to keep running the steamCMD command. Just keep running those until the file appears. If running it a few times doesn't work, then you need to run steamcmd.sh, then each command preceeded by plus, so -login steamusername steampasswordthenforce_install_dir directory/you/want/to/install/to*etc We now need to make a Zomboid folder in the user home folder we’ll be running the server from. In this case for me it’s steam (but depending how you did it, it’ll vary.) So now we’ll do:cd /home/steamThenmkdir ZomboidThencd /home/steam/ZomboidThenmkdir dbNow reconnect FileZilla and go download this empty db file: https://dl.dropboxus...553835/world.db Whether or not you will whitelist the server it’s best to put the file in. You’ll now need to edit the projectzomboid-dedi-server.sh and set your RAM values. This is dependant on how much RAM your server has, I personally didn’t set them to use my complete server capacity, I did about half but the choice is up to you. (Kirrus: Don't set more than 80% of your VM's capacity.) Use FileZilla and double click on the file and it should open it up in an editor, find these two lines: -Xms1024m \ -Xmx1024m \ And edit the values to your choosing. Save and close the file and it will prompt you for the root password of FileZilla so put it in and it will be updated. Now something I specifically left for last, since I screwed it up. I guarantee you though this step is unmissable. We need one more thing and all you have to do iswget http://kirrus.co.uk/stuff/pz/wheezy-glibc-sid.shbash wheezy-glibc-sid.shThis is only required for those who are running a Debian OS, Ubuntu (I am told) should be fine. Nearly Home! We’re almost there. So here’s what we got to do now.cd /home/steam/Steam/SteamApps/common/ProjectZomboidthen./projectzomboid-dedi-server.shIt will start the server. You celebrating yet? Don’t. We’re not quite done yet, do CTRL + C and it’ll shut down the server program. We can’t use the usual things like exit (yet - it’s on the todo list) so for now CTRL + C will close the server. So now we got to boot up fileZilla and navigate to the Zomboid folder we created. As long as everything went smoothly you should have a lot more files now. Go into the server folder and you should see a serverOptions.ini It will contain: PVP=truePauseEmpty=trueGlobalChat=trueOpen=true Most should be self explanatory but if not, here we go. PVP - Allow or don’t allow players to hurt/kill each other. PauseEmpty - I’m not certain but I believe it basically suspends the server when there are no players around. GlobalChat - Whether or not to allow the players to speak to all the players through the /all chat command. Open - Whether it to be whitelisted or not. If you want the server to be whitelisted I would love to help, but at this point in time I have been unable to get whitelisting to work on the server. Right. Do what you wish save, password then exit. Now here’s where that Screen we talked about in the beginning comes in handy. You see if you start the server without it and just do what we did above but didn’t close the server you would find that in order to keep the PZ server running, you would need to keep the PuTTY terminal running. Which would mean you would need to keep your computer running, which would kind of defeat the purpose of having the VPS. When back home type:screenYou will be taken to a wall of text, just hit enter until the text goes away and your left with a blank screen except for your user email@example.com thing. Now what you do here is cd /home/steam/Steam/SteamApps/common/ProjectZomboidThen./projectzomboid-dedi-server.shThe server should start up and eventually be greeted with: "*** SERVER STARTED ****". At the bottom. You can now close PuTTY and play on your server. If you ever need to get back to that screen, when you log back into root type:screen -drand it should take you back to server screen. Don’t initiate multiple versions of the screen, otherwise you’re going to have a bit of a problem down the line. Thanks for reading, that’s the bulk of the tutorial so now here’s some FAQ and handy tips. Server Screen Controls: CTRL + C - Closes the server. FAQ Q: “I get a missing file/folder error when I boot the server.” A: “Usually means you didn’t put the “Zomboid” folder in the right place. Remember to create a “db” folder and put in the “world.db” file in there. Q: “There appears to be some error regarding RakNet. What’s that about?” A: It’s probably to do with kirrus’s script as linked above. Probably means you didn’t install it correctly. Q: "I got a long confusing password, I think I'll change it..." A: NO! Don't. Chances are the password given is incredibly secure, if you change it you could make the server more vulnerable. Personally I suggest just leaving it as default, at the very least your root password should remain unchanged. Q: How do I upgrade the server when a patch is released A: Shut down the gameserver (Ctrl-C), and then run the steam command. A video version of the guide will follow later. Thanks to Kirrus for double checking the info and giving pointers. MAKE SURE CLIENT AND SERVER ARE RUNNING THE SAME PROJECT ZOMBOID BUILD IF YOU WISH TO CONNECT! Kidlonewolf, BeastlyBean, zcundizmond and 13 others 16 Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.