Project Zomboid

Project Zomboid

30 ratings
How to create a server [Linux - Debian 11]
By Dane and 1 collaborators
Hi survivor !

This guide is made for people who want setup a dedicated server on Linux :]

Ultimate Multiplayer Guide [b41]

Discord of the french speaking community of Project Zomboid : https://discord.gg/NFBA3dZHuC

2
   
Award
Favorite
Favorited
Unfavorite
1) Setup server on Linux (Debian 11)
This guide requires some knowledge




Connection on the VPS

1) Download PuTTy (https://www.putty.org/)
2) Start PuTTy
3) Enter the IP of your VPS in Host Name
4) Enter the port of your VPS (22 by default )




Connection on the VPS

1) Enter the login ID
2) Enter the password

Install package

Put the commands in the console following this order

  • dpkg --add-architecture i386
  • sudo apt install screen libsdl2-2.0-0:i386
  • sudo apt-get update && apt-get upgrade

Create a user

You can change "pzuser" by what you want

  • sudo adduser pzuser
  • enter the password when the console ask you
  • usermod -aG sudo pzuser
  • su - pzuser


Install SteamCMD

You can change "pzserver" by what you want, it's the directory of ProjectZomboid Dedicated server's files



Install ProjectZomboid Dedicated server files

  • ./steamcmd.sh
  • force_install_dir /home/pzuser/pzserver/
  • login anonymous
  • app_update 380870 validate
  • exit


2) Start the server
The first launch will create all config files of your server

  • cd
  • cd pzserver
  • ./start-server.sh


You must put the password of the admin account in Project Zomboid (it's a new password)


After this message, you can launch Project Zomboid and connect to your server


Connect to your server

  • Launch Project Zomboid
  • Go to Online
  • Go to server list
  • Enter the IP of you server in IP input
  • Enter the port (default : 16261)
  • Enter "admin" as username or other name if you don't want to log in as admin
  • Enter the admin password or your user account's password

2.1) Run server 24h/24h
If you want your server to run in the background 24h/24h




Commands

  • screen
  • cd pzserver
  • ./start-server.sh
  • CTRL + A + D

You can quit PuTTy, your server will run in background.

You can resume the server's console when you will connect again to PuTTy

  • screen -r
3) Stop a server
Stop a running server

Write : quit


4) Server configuration
  • cd
  • cd Zomboid
  • cd Server


Files :

> servertest.ini
> servertest_SandboxVars.lua
> servertest_spawnpoints.lua
> servertest_spawnregions.lua
4.1) servertest.ini
This file contains the main configuration of your server

The parameters' description are written in it




  • nano servertest.ini
  • CTRL + O (save)
  • CTRL + X (exit)




nightlengthmodifier=1
PVP=false
PauseEmpty=true
GlobalChat=true
ChatStreams=s,r,a,w,y,sh,f,all
Open=true
ServerWelcomeMessage=WELCOME<LINE><LINE> Survivor
LogLocalChat=false
AutoCreateUserInWhiteList=true
DisplayUserName=true
ShowFirstAndLastName=false
SpawnPoint=0,0,0
SafetySystem=false
ShowSafety=false
SafetyToggleTimer=2
SafetyCooldownTimer=3
SpawnItems=
DefaultPort=16261
ResetID=831494815
Mods=
Map=Muldraugh, KY
DoLuaChecksum=true
DenyLoginOnOverloadedServer=true
Public=true
PublicName= Public server
PublicDescription= Nice server
MaxPlayers=32
PingFrequency=10
PingLimit=400
HoursForLootRespawn=48
MaxItemsForLootRespawn=4
ConstructionPreventsLootRespawn=true
DropOffWhiteListAfterDeath=false
NoFire=false
AnnounceDeath=false
MinutesPerPage=0.2
SaveWorldEveryMinutes=10
PlayerSafehouse=true
AdminSafehouse=false
SafehouseAllowTrepass=true
SafehouseAllowFire=false
SafehouseAllowLoot=true
SafehouseAllowRespawn=true
SafehouseDaySurvivedToClaim=0
SafeHouseRemovalTime=144
AllowDestructionBySledgehammer=false
KickFastPlayers=false
ServerPlayerID=313828062
RCONPort=27015
RCONPassword=
DiscordEnable=false
DiscordToken=
DiscordChannel=
DiscordChannelID=
Password=
MaxAccountsPerUser=0
SleepAllowed=false
SleepNeeded=false
SteamPort1=8766
SteamPort2=8767
WorkshopItems=
SteamScoreboard=true
SteamVAC=true
UPnP=true
UPnPLeaseTime=86400
UPnPZeroLeaseTimeFallback=true
UPnPForce=true
CoopServerLaunchTimeout=20
CoopMasterPingTimeout=60
VoiceEnable=true
VoiceComplexity=5
VoicePeriod=20
VoiceSampleRate=24000
VoiceBuffering=8000
VoiceMinDistance=10.0
VoiceMaxDistance=20.0
Voice3D=true
PhysicsDelay=500
SpeedLimit=70.0
server_browser_announced_ip=
UseTCPForMapDownloads=false
PlayerRespawnWithSelf=false
PlayerRespawnWithOther=false
FastForwardMultiplier=40.0
PlayerSaveOnDamage=true
SaveTransactionID=true
DisableSafehouseWhenPlayerConnected=false
Faction=true
FactionDaySurvivedToCreate=0
FactionPlayersRequiredForTag=1
AllowTradeUI=true
DisableRadioStaff=false
DisableRadioAdmin=true
DisableRadioGM=true
DisableRadioOverseer=false
DisableRadioModerator=false
DisableRadioInvisible=true
ClientCommandFilter=-vehicle.*;+vehicle.damageWindow;+vehicle.fixPart;+vehicle.installPart;+vehicle.uninstallPart
ItemNumbersLimitPerContainer=0
BloodSplatLifespanDays=7
AllowNonAsciiUsername=true
BanKickGlobalSound=true
RemovePlayerCorpsesOnCorpseRemoval=false
ZombieUpdateMaxHighPriority=50
ZombieUpdateDelta=0.5
ZombieUpdateRadiusLowPriority=45.0
ZombieUpdateRadiusHighPriority=10.0
TrashDeleteAll=true
PVPMeleeWhileHitReaction=true
MouseOverToSeeDisplayName=true
HidePlayersBehindYou=true
PVPMeleeDamageModifier=30.0
PVPFirearmDamageModifier=50.0
CarEngineAttractionModifier=0.5




nightlengthmodifier

The night's length, this can be edited to change the speed at which the night will progress. 0.5 will make it last twice as normal, 2 will make it go double as fast.

PVP

Player vs Player combat - true = on, false = off

PauseEmpty

If set to true, this will pauset your server if there are no players on it.

GlobalChat

If set to true, it allows the "/all" channel, making your players able to safely communicate with everyone.

Open

Whitelisting - If true, anyone can join, if false, players need to be added to a whitelist in order to play.

ServerWelcomeMessage

Welcome to Project Zomboid MP ! to chat locally press 't', to global chat press 'y' or add '/all' before chatting <LINE> Type '/help' to have a list of available commands <LINE> <RGB:1,1,1>
You can change the message players see each time they log-in.

LogLocalChat

When using the "/say" command nearby people will be able to read it in the chat log, if set to false people can only view the message on their screen.

SpawnPoint

To set a custom spawn point, change 0,0,0 to something like 1,2,0 the 1 is the first number (x position), 2 is the 2nd (y position), and 0 is the level (z position). So if you want to be upstairs in a room then you change that number. you can use the Project Zomboid Map to look for specific coordinates to spawn onto.

DoLuaChecksum

Are you getting an error that says "you have been kicked! Your lua version does not match the server." ? This usually means you have mods installed and need to either turn off this by setting the argument to false, or you have to uninstall all mods, including ones which are directly installed into your media files.

MaxItemsForLootRespawn

This option is very important when you want to keep your house items from disapearing because of respawn ! Whatever this is set at, any chest/item that doesn't equal this amount will respawn. So if it's 4, make sure every container in your house has at least 4 items in it or they will respawn !

AnnounceDeath

Make it so your embarrassing death is broadcasted to your friends
4.2) Add mods to your server
In servertest.ini




Search parameters

mods=
WorkshopItems=

Go to a Workshop mod page
(example : https://steamoss.com/sharedfiles/filedetails/?id=2659216714)

Commands

  • cd Zomboid
  • mkdir mods

Get the Workshop ID and Mod ID at the end of the description of the mod



And copy past here

mods=OutTheWindow
WorkshopItems=2659216714

(in screen, you can see that two added mods are separated by ";"








Save your servertest.ini file and exit

  • CTRL + O
  • CTRL + X

4.3) servertest_SandboxVars.lua
Sandbox Parameters Configuration File

The parameters' description are written in it




  • nano servertest_SandboxVars.lua
  • CTRL + O (save)
  • CTRL + X (exit)




SandboxVars = {
VERSION = 4,
Zombies = 4,
Distribution = 1,
DayLength = 3,
StartYear = 1,
StartMonth = 7,
StartDay = 9,
StartTime = 2,
WaterShut = 2,
ElecShut = 2,
WaterShutModifier = 14,
ElecShutModifier = 14,
FoodLoot = 2,
CannedFoodLoot = 2,
LiteratureLoot = 2,
SurvivalGearsLoot = 2,
MedicalLoot = 2,
WeaponLoot = 2,
RangedWeaponLoot = 2,
AmmoLoot = 2,
MechanicsLoot = 2,
OtherLoot = 2,
Temperature = 3,
Rain = 3,
ErosionSpeed = 3,
ErosionDays = 0,
XpMultiplier = 1.0,
ZombieAttractionMultiplier = 1.0,
VehicleEasyUse = false,
Farming = 3,
CompostTime = 2,
StatsDecrease = 3,
NatureAbundance = 3,
Alarm = 4,
LockedHouses = 6,
StarterKit = false,
Nutrition = true,
FoodRotSpeed = 3,
FridgeFactor = 3,
LootRespawn = 1,
SeenHoursPreventLootRespawn = 0,
WorldItemRemovalList = "Base.Vest,Base.Shirt,Base.Blouse,Base.Skirt,Base.Shoes,Base.Hat,Base.Glasses",
HoursForWorldItemRemoval = 24.0,
ItemRemovalListBlacklistToggle = false,
TimeSinceApo = 1,
PlantResilience = 3,
PlantAbundance = 3,
EndRegen = 3,
Helicopter = 2,
MetaEvent = 2,
SleepingEvent = 1,
GeneratorSpawning = 3,
GeneratorFuelConsumption = 1.0,
SurvivorHouseChance = 3,
VehicleStoryChance = 3,
ZoneStoryChance = 3,
AnnotatedMapChance = 4,
CharacterFreePoints = 0,
ConstructionBonusPoints = 3,
NightDarkness = 3,
InjurySeverity = 2,
BoneFracture = true,
HoursForCorpseRemoval = 216.0,
DecayingCorpseHealthImpact = 3,
BloodLevel = 3,
ClothingDegradation = 3,
FireSpread = true,
DaysForRottenFoodRemoval = -1,
AllowExteriorGenerator = true,
MaxFogIntensity = 1,
MaxRainFxIntensity = 1,
EnableSnowOnGround = true,
MultiHitZombies = false,
RearVulnerability = 3,
AttackBlockMovements = true,
AllClothesUnlocked = false,
CarSpawnRate = 3,
ChanceHasGas = 1,
InitialGas = 2,
FuelStationGas = 4,
CarGasConsumption = 1.0,
LockedCar = 3,
CarGeneralCondition = 2,
CarDamageOnImpact = 3,
DamageToPlayerFromHitByACar = 1,
TrafficJam = true,
CarAlarm = 2,
PlayerDamageFromCrash = true,
SirenShutoffHours = 0.0,
RecentlySurvivorVehicles = 1,
EnableVehicles = true,
Map = {
AllowMiniMap = false,
AllowWorldMap = true,
},
ZombieLore = {
Speed = 1,
Strength = 2,
Toughness = 2,
Transmission = 1,
Mortality = 5,
Reanimate = 3,
Cognition = 3,
CrawlUnderVehicle = 5,
Memory = 2,
Decomp = 1,
Sight = 2,
Hearing = 2,
Smell = 2,
ThumpNoChasing = false,
ThumpOnConstruction = true,
ActiveOnly = 1,
TriggerHouseAlarm = false,
ZombiesDragDown = true,
ZombiesFenceLunge = true,
},
ZombieConfig = {
PopulationMultiplier = 1.0,
PopulationStartMultiplier = 1.0,
PopulationPeakMultiplier = 1.5,
PopulationPeakDay = 28,
RespawnHours = 72.0,
RespawnUnseenHours = 16.0,
RespawnMultiplier = 0.1,
RedistributeHours = 12.0,
FollowSoundDistance = 100,
RallyGroupSize = 20,
RallyTravelDistance = 20,
RallyGroupSeparation = 15,
RallyGroupRadius = 3,
},
}


4.4) Allocate more RAM to Java (IMPORTANT)
If your server crashes it means that you did not allocate enough RAM to JAVA and need to remedy this




Commands

  • cd
  • cd pzserver
  • nano ProjectZomboid64.json
  • -Xmx put -Xmx=8g (if your server have 16go RAM).
  • CTRL + O
  • CTRL + X



5) Update server version PZ
If you get this error when trying to connect to a server
This means that the server does not have the latest version of Project Zomboid






Commands

  • cd
  • cd steamcmd
  • ./steamcmd.sh
  • force_install_dir /home/pzuser/pzserver/
  • login anonymous
  • app_update 380870 -beta b41multiplayer validate
  • exit (at the end)

6) Hard Reset
To hard reset the server, proceed as follow




Commands

  • cd
  • cd Zomboid
  • cd Saves
  • cd Multiplayer
  • rm -rf servertest



  • cd
  • cd Zomboid
  • cd db
  • rm -rf servertest.db




When you restart the server, it will recreate the original files
7) Youtube example
Quick video to install a Project Zomboid server in 5 min.

After installation in the video, I quickly show what's in the tutorial

8) Manage server with RCON



https://github.com/gorcon/rcon-cli/re...

9 Comments
Joelbu 5 Feb, 2024 @ 10:16am 
Question: If I want to install mods and add the Name and ID into the .lua, are they getting installed with the next start or do I somehow have to download them myself?
Kiliko 27 Apr, 2023 @ 6:31am 
I have a question, if the server (V RISING for example or ZOMBOID), is for 64 bits, with i386 steamcmd does not work, right? I have tried to create these servers and it does not let me install the app because it says it is for 64 bits.
Lil Tony 24 Jan, 2023 @ 5:06am 
What if I want to host it on my Linux PC and not on a VPS?
STEIN 7 Jan, 2023 @ 8:42am 
If you're installing on Debian 11 bullseye, don't follow the guide steps for Install SteamCMD . Instead, follow these steps:
https://developer.valvesoftware.com/wiki/SteamCMD#Downloading_SteamCMD
BANG ZUL 6 Apr, 2022 @ 6:36pm 
want to ask did project zomboid run smoothly on linux ? i used to play on windows bit laggy
ram 4gb ssd 256 amd radeon vram 512mb
Deckard 9 Jan, 2022 @ 5:55am 
I tried to follow this guide to setup a server on my home machine in my router network, but it seems like the server is no listening to the port. It runs okay, but I cannot connect from either local router network (192.168.0.0), or the global address - server is not responding, and the logs are not registering connection attempts. Networking and port forwarding seems OK since I can connect to the server via ssh from anywhere.
Deckard 9 Jan, 2022 @ 5:52am 
@Shabazz You need to swap the second command line and the third, i.e. you need to run 'sudo apt-get update && apt-get upgrade' BEFORE installing libsdl.
Shabazz 25 Dec, 2021 @ 3:54pm 
Install package

Put the commands in the console following this order

dpkg --add-architecture i386
sudo apt install screen libsdl2-2.0-0:i386
sudo apt-get update && apt-get upgrade



When I type: sudo apt install screen libsdl2-2.0-0:i386, I get the error:


Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package libsdl2-2.0-0:i386
E: Couldn't find any package by glob 'libsdl2-2.0-0'
E: Couldn't find any package by regex 'libsdl2-2.0-0'


I tried it on a fresh Debian 11 server, as well as a ubuntu 18.04 server.
FireFlower 14 Dec, 2021 @ 2:29pm 
Pretty nice, you might want to tell people their ProjectZomboid64.json (or 32bit version if somebody is still using that) will be reset after updating, so it is important to readjust ram after updating.

for example update/install script:


!/bin/bash

steamcmd +login anonymous +app_update 380870 -beta b41multiplayer -validate +quit

DIR="$HOME/.steam/steamapps/common/Project Zomboid Dedicated Server/"
cd $DIR

cp ProjectZomboid64.json ProjectZomboid64.json-1
sed -i 's/2048m/4096m/g' ProjectZomboid64.json
diff --color -c1 ProjectZomboid64.json ProjectZomboid64.json-1
cp start-server.sh start-server.sh-1
sed -i 's/2048m/4096m/g' start-server.sh
diff --color -c1 start-server.sh start-server.sh-1
exit


Also when you want the server to just run in screen, you can do it in oneliner: screen bash start-server.sh