Perfect Heist 2
 This topic has been pinned, so it's probably important
yeswecamp_DEV  [developer] Apr 8, 2022 @ 3:59pm
[GUIDE] How to host your own dedicated server!
If you want to play on your own dedicated server instead of hosting a session in-game, here is a quick guide on how to setup a dedicated server on Linux!

There also is a community-created docker image that should make things easier: https://github.com/murzart/PerfectHeist2

Add the following to a StartServer.sh file:
echo Updating game... login anonymous steamcmd +force_install_dir /home/dev1/ph2sv +app_update 1964150 +quit echo Starting server... cd /home/dev1/ph2sv/PerfectHeist2/Binaries/Linux /home/dev1/ph2sv/PerfectHeist2/Binaries/Linux/PerfectHeist2Server NewYorkCity -Port=7777 -QueryPort=27017

If you host multiple server instances on the same machine, make sure every instance has its own port and queryPort!

You can replace "NewYorkCity" with "HugeBank", "Classic_Heist_Big", "CasinoHeist", and "Bank4" !

In /home/dev1/ph2sv/PerfectHeist2/Saved/Config/LinuxServer you also find a Game.ini file where you can configure the server, here you can see all settings:
[Server] name="Server Name" ; how many bots will play against a single player if no other human players are online bots=2 ; password settings pw = false pws = "TOPSECRET" [Advanced] ; class selection time picktime=20 ; if spectators are allowed spectators=false infiniteCopRespawns = false ; minimum amount of money robbers have to steal minimumStolenAmount = 30000 ; percentage of players forced into the cop team as long as "ignoreTeamLimits" is false copPercentage = 30 ; if true, players can join any team they want no matter how many players are already in there ignoreTeamLimits = false ; if true, cops cant be fired if they hit NPCs while in a firefight against a robber combatfireProtected = false ; if true, cops are only allowed to kill robbers that already performed suspicous actions noRandomKills = false ; if true, cops only die and no longer get fired after killing NPCs copRespawnAfterNpcKill = false ; amount of saved money robbers gain when a cop kills an NPC CopNpcsKillReward = 0 ; overtime settings, duration in secs overtime = false overtimeduration = 60 ; roundtime in seconds roundtime = 300 ; robber respawns per round RobberRespawns = 0 ; if true, cops can kill NPCs without consequences copsCantBeFired = false ; if true, steam users with bans are blocked, but it might lead to connection issues of innocent players if Steam servers are down SteamTickets = false ; allow third person allowTP = false ; if true, sprinting costs stamina sprintingStamina = false ; if true, noone can sprint noSprinting = false ; if true, prevent team damage from bullets NoTeamDamage = false ; use your SteamID64 to kick players without a vote in-game ServerOwnerID = 123456789 MaxPlayers = 16 ; path of a downloaded custom map ; map in the .sh file needs to be changed to CustomMap WorkshopFolderFullPath="C:/map/1234567" ; needs to be set to the SteamID of the used custom map WorkshopMapID=1234567
Last edited by yeswecamp_DEV; Nov 9, 2022 @ 8:28am
< >
Showing 1-15 of 83 comments
HustleMan May 8, 2022 @ 9:47pm 
Does the dedicated server need a GPU? Everytime I start it says it needs vulkan drivers
HustleMan May 8, 2022 @ 11:07pm 
Also, what ports does the server need open? I need a range to setup port forwarding
yeswecamp_DEV  [developer] May 9, 2022 @ 8:20am 
Originally posted by HustleMan:
Does the dedicated server need a GPU? Everytime I start it says it needs vulkan drivers

Are you using the start.sh I posted here? the "PerfectHeist2Server" doesnt need a GPU
yeswecamp_DEV  [developer] May 9, 2022 @ 8:20am 
Originally posted by HustleMan:
Also, what ports does the server need open? I need a range to setup port forwarding

make sure your server allows connections through those ports:
UDP 27017 Query port for Steam's server browser (= -QueryPort)
UDP 7777 Game client port (= -Port)
UDP 7778 Raw UDP socket port (always Game client port +1)

Try forwarding those for UDP+TCP, and the ports next to them as well since Steam sometimes uses them as well
HustleMan May 9, 2022 @ 2:24pm 
Thanks for the response!

There are a couple of things I wanna update/add in the guide above:

- Make sure you're using a server with about 4GB of RAM (1GB doesn't work). Also, this guide is for Ubuntu

- Install steamcmd using the instructions in the following link: https://developer.valvesoftware.com/wiki/SteamCMD

- Use this command to install PH2 server. You can also use this same command to update the PH2 server.
steamcmd +force_install_dir ~/ph2sv +login anonymous +app_update 1964150 +quit

- After you install PH2 server, you may need to copy steamclient.so to your ~/.steam folder if your server complains that it cannot connect to the Steam API. Otherwise, you will not be able to find your server in the Server Browser menu:
# Run this you're using a x64 OS mkdir ~/.steam/sdk64 cp ~/ph2sv/linux64/steamclient.so ~/.steam/sdk64/. # I don't know how to install for 32-bit OS. # ~/ph2sv/steamclient.so is the 32-bit steam client, # but I'm not sure which folder to copy it to mkdir ~/.steam/sdk cp ~/ph2sv/steamclient.so ~/.steam/sdk/.

- Optional: If you're using the .sh script in the original post, replace
steamcmd +force_install_dir /home/dev1/ph2sv +app_update 1964150 +quit
with
steamcmd +force_install_dir ~/ph2sv +login anonymous +app_update 1964150 +quit
Last edited by HustleMan; May 9, 2022 @ 3:19pm
yeswecamp_DEV  [developer] May 9, 2022 @ 2:25pm 
Originally posted by HustleMan:
Thanks for the response!

There are a couple of things I wanna update/add in the guide above:

- Make sure you're using a server with about 4GB of RAM (1GB doesn't work)

- Install steamcmd using the instructions in the following link: https://developer.valvesoftware.com/wiki/SteamCMD

- Use this command to install PH2 server. You can also use this same command to update the PH2 server.
# replace /home/usernamehere/ with your own user's home folder (/home/ubuntu) # you can try using the path ~/ph2sv instead steamcmd +force_install_dir /home/usernamehere/ph2sv +login anonymous +app_update 1964150 +quit

- After you install PH2 server, you may need to copy steamclient.so to your ~/.steam folder if your server complains that it cannot connect to the Steam API. Otherwise, you will not be able to find your server in the Server Browser menu:
mkdir ~/.steam/sdk64 # Run this you're using a x64 OS cp ~/ph2sv/linux64/steamclient.so ~/.steam/sdk64/. # Run this if you're using a 32-bit OS cp ~/ph2sv/steamclient.so ~/.steam/sdk64/.

Thank you so much for compiling the guide, will work on integrating it into mine!
HustleMan May 9, 2022 @ 2:40pm 
Also, one more question: can you run commands on the server like /kick /ban /changemap? Is there a way to run these commands in-game remotely, like if I were playing on my server?
Last edited by HustleMan; May 9, 2022 @ 2:41pm
yeswecamp_DEV  [developer] May 9, 2022 @ 2:42pm 
Originally posted by HustleMan:
Also, one more question: can you run commands on the server like /kick /ban /changemap? Is there a way to run these commands in-game remotely, like if I were playing on my server?

No, currently not, unfortunately!
HustleMan May 9, 2022 @ 4:08pm 
Thank you so much for answering my questions!

Just one more though haha: does the roundtime parameter in Game.ini actually work? I've set it to 220 seconds and in-game the round timer is actually 5 minutes. Here's my Game.ini file
[Server] Name=~ Best Server NA ~ bots=0 [Advanced] minimumStolenAmount=50000 copPercentage=30 combatfireProtected=true overtime=true overtimeduration=60 roundtime=220

When hosting a game thru the actual game itself (self-hosted), I can set the timer to 220 in the Advanced Options menu itself and it works fine, but I can't seem to change this value on the dedicated server
Last edited by HustleMan; May 9, 2022 @ 4:10pm
yeswecamp_DEV  [developer] May 9, 2022 @ 4:22pm 
Originally posted by HustleMan:
Thank you so much for answering my questions!

Just one more though haha: does the roundtime parameter in Game.ini actually work? I've set it to 220 seconds and in-game the round timer is actually 5 minutes. Here's my Game.ini file
[Server] Name=~ Best Server NA ~ bots=0 [Advanced] minimumStolenAmount=50000 copPercentage=30 combatfireProtected=true overtime=true overtimeduration=60 roundtime=220

When hosting a game thru the actual game itself (self-hosted), I can set the timer to 220 in the Advanced Options menu itself and it works fine, but I can't seem to change this value on the dedicated server

Hi, thank for letting me know there is indeed a bug related to loading the server settings that I will fix in the next update, some settings might not be applied correctly when setting the "overtime" parameter. Since it is enabled by default, I would advise you to just use

[Server] Name=~ Best Server NA ~ bots=0 [Advanced] minimumStolenAmount=50000 copPercentage=30 combatfireProtected=true overtimeduration=60 roundtime=220

which in theory should prevent the bug and set the round time to your desired length!
daddy O May 13, 2022 @ 10:28am 
How can I set the maximum player number on the dedi?
yeswecamp_DEV  [developer] May 13, 2022 @ 12:01pm 
Originally posted by daddy O:
How can I set the maximum player number on the dedi?

Currently there is no setting for it, but I will add one in the next updates!
daddy O May 15, 2022 @ 4:54am 
Thanks, that would be great. What are the names of the other maps (for the server command line parameter)? And can we host Workshop maps on a dedi?
yeswecamp_DEV  [developer] May 15, 2022 @ 9:19am 
Originally posted by daddy O:
Thanks, that would be great. What are the names of the other maps (for the server command line parameter)? And can we host Workshop maps on a dedi?

Workshop maps are currently not available on dedicated servers but I am working on it, the internal map names are "HugeBank", "Classic_Heist_Big", and "CasinoHeist"
NebelRebell | Max May 24, 2022 @ 8:15pm 
Hello,
maybe I found here help? I want to install a "Perfect Heist 2 Dedicated Server" on Ubuntu.

- SteamCMD is correct installed
- User is ph2ds
- Change in User
- Install he Server and found it in /home/ph2ds

But there isn't an folder named "LinuxServer" and I didn't found the "Game.ini", what I did wrong pls.
< >
Showing 1-15 of 83 comments
Per page: 1530 50