Jump to content

Dedicated Server Quick Setup Guide - Mac OS X


Recommended Posts

  • Developer

This guide will help you set up a dedicated server on Mac OS X. The commands in this guide must be entered in the Terminal.app. The character ~ at the beginning of directories and filenames is shorthand for $HOME which is a variable that refers to your home directory, for example, /Users/alice/.

1. Install steamcmd.

Spoiler

Download and install steamcmd by following the instructions here: https://developer.valvesoftware.com/wiki/SteamCMD#OS_X . This guide will assume that you have installed steamcmd to ~/steamcmd .

A shortened version of the necessary commands:

mkdir ~/steamcmd/
cd ~/steamcmd/
curl -O "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_osx.tar.gz"
tar -xvzf steamcmd_osx.tar.gz

2. Configure and download the server settings

Spoiler

2a. Visit the Klei Accounts site and log in to your account. (Please note, Dedicated Servers are not supported for the Xbox and PlayStation versions of the game.)

Spoiler

2_login_ku.png

2b. On the accounts page, visit the “GAMES” tab, then scroll down to Don’t Starve Together and click on the “Game Servers” button.

Spoiler

3_gameservers.png

2c. If you don’t have any server yet, please click the “ADD NEW SERVER” button. If you have a valid server, click the green “CONFIGURE” button. Expired servers are colored in red and should be deleted.

Spoiler

add_new_server.jpg

2d. In the “Configure Server” page you will find a form with some options that you can edit to customize your server. Once you are ready, click the “Download Settings” button. Download the Zip archive, extract the content, and place the folder “MyDediServer” inside ~/Documents/Klei/DoNotStarveTogether/.

Spoiler

configure_server.jpg

3. Create the script that will run the servers.

Spoiler

Download this shell script and move it to ~/run_dedicated_servers.sh.

4. Give the script executable permissions

Spoiler

In a terminal, run: chmod u+x ~/run_dedicated_servers.sh

5. Run the script to start the dedicated servers:

Spoiler

In a terminal, run: ~/run_dedicated_servers.sh

 

 

  • Like 7
  • Thanks 1
Link to comment
Share on other sites

If you prefer multiple terminal windows:

1. Comment/remove the following in run_dedicated_servers.sh:

#run_shared+=(-monitor_parent_process $$)

#"${run_shared[@]}" -shard Caves  | sed 's/^/Caves:  /' &
#"${run_shared[@]}" -shard Master | sed 's/^/Master: /'

2. Add the following code:

osascript <<END
tell application "Terminal"
    do script "cd \"`pwd`\";${run_shared[@]} -shard Master"
end tell
tell application "Terminal"
    do script "cd \"`pwd`\";${run_shared[@]} -shard Caves"
end tell
END

You'll now have a separate terminal window for Master & one for Caves.  Note: You must manually c_shutdown() all instances since Caves no longer monitors if Master is alive.

  • Like 1
Link to comment
Share on other sites

Thank you so much for this! My friends and I have been looking for a way to have a server up and running. Just a few questions:

1. Is there any way to have an existing, non-dedicated server world copied into my current dedicated server?

2. When I started the server, it started in Caves. How can I get an overworld spawn?

3. What are some ways my friends can join my server when I'm not around?

I may have more questions depending on if it goes well or not. Thanks in advance!

Link to comment
Share on other sites

hi @ToNiO55,i use this forum ’s way to dedicated DST, i can ' t  use any mods, i watch this post http://steamcommunity.com/sharedfiles/filedetails/?id=591543858,but my computer ‘s directory structure is different of your,i just have ~/Documents/Klei/DoNotStarveTogether/MyDediServer ,this forum 's way generate it. so may i add mods? please help me ... thx

Link to comment
Share on other sites

if you wanna add mod to it and rewrite the script "dedicated_server_mods_setup.lua", delete "validate" in step 9, or the lua file will be refreshed and never take effect every time the server start.

orignial:

./steamcmd.sh +force_install_dir "$install_dir" +login anonymous +app_update 343050 validate +quit

after:

./steamcmd.sh +force_install_dir "$install_dir" +login anonymous +app_update 343050 +quit

 

  • Like 3
Link to comment
Share on other sites

Hi there, im having the same issue as @eight0. The directory for Mac os is wrong.  Following this path, you will stop at steamapps>common>Dont starve together dedicated servers > Nothing inside the folder except the application and version.txt. Even for DST game itself, the folder is empty. I have no idea where the workshop mods are saved in for mac

Does not exist

Edited by GiraffeOnCrackk
Link to comment
Share on other sites

I am having problems with running the server itself it keeps saying:

Error: Missing /Users/(MacUser)/steamcmd directory!

and

/Users/(MacUser)/run_dedicated_servers.sh: line 21: cd: /Users/(MacUser)/steamcmd: No such file or directory

whenever i do step 11 and i can't figure out why

Link to comment
Share on other sites

Hello! I have a problem with creating a server, after executing all the points of the instruction, while using the command:
~/run_dedicated_servers.sh

terminal responds:

./steamcmd.sh: line 32: /Users/User/steamcmd/osx32/steamcmd: Bad CPU type in executable

Error: Missing file: /Users/User/dontstarvetogether_dedicated_server/dontstarve_dedicated_server_nullrenderer.app/Contents/MacOS/

Can someone explain to me what the problem is? Is it solvable?

macOS Catalina 10.15.1

Edited by kucaymon
  • Like 2
Link to comment
Share on other sites

On 5/1/2020 at 1:45 AM, 0atmeaI said:

Please elaborate the instructions of number 3. Pleaase. 

When it opens on safari, just save it as source code of the page (File, save as...) with the name "run_dedicated_servers.sh" (without any other extension) and locate it on your home directory, for example, /Users/alice/ (You can get into it just writing ~ on Spotlight). Hope it helps...

  • Thanks 1
  • Sanity 1
Link to comment
Share on other sites

Hi, i don't know what to do. I tried to create the server, but it stays hours and hours at this point: 

 

(im copying only the last lines of terminal)

 

Caves:  [00:00:54]: Sim paused

Master: [00:01:02]: Registering master server in US lobby

Caves:  [00:05:53]: Registering slave in US lobby

Caves:  [00:10:53]: Registering slave in US lobby

Caves:  [00:15:53]: Registering slave in US lobby

Caves:  [00:20:53]: Registering slave in US lobby

Link to comment
Share on other sites

On 6/12/2020 at 7:30 PM, jbliria said:

Hi, i don't know what to do. I tried to create the server, but it stays hours and hours at this point: 

 

(im copying only the last lines of terminal)

 

Caves:  [00:00:54]: Sim paused

Master: [00:01:02]: Registering master server in US lobby

Caves:  [00:05:53]: Registering slave in US lobby

Caves:  [00:10:53]: Registering slave in US lobby

Caves:  [00:15:53]: Registering slave in US lobby

Caves:  [00:20:53]: Registering slave in US lobby

same thing here with master and slave and it doesn't show on server list...
server and games fully updated, using no mods so I can at least make it work before configuring them, trying Default key, different key, no pass, with password, lots of configurations no luck what so ever, sending logs and cluster config to shed some light into it

server_log.txt server_log.txt cluster.ini

Link to comment
Share on other sites

I recently started using the Mac dedicated server build, moving in from Linux.

@fe_quirino did you try listing just LAN servers? (The server should show up even if your DST client and the dedicated server are running on the same machine).

I'm also getting the "SteamGameServer_Init failed" error (and the server isn't listed in the global listing), but never paid much attention to it - I always connect via LAN listings, and friends connect by joining game, which works. Skin drops also work.

This does seem like a bug in the mac build (a repeat of similar bugs seen on windows and linux alike). Can you report the issue in the bug tracker?

Link to comment
Share on other sites

13 hours ago, myxal said:

 

I'm also getting the "SteamGameServer_Init failed" error (and the server isn't listed in the global listing), but never paid much attention to it - I always connect via LAN listings, and friends connect by joining game, which works. Skin drops also work.

This does seem like a bug in the mac build (a repeat of similar bugs seen on windows and linux alike). Can you report the issue in the bug tracker?

found a fix is on a different post here in the foruns I made earlier today... now is showing on server list and everywhere, is actually a Steam file bug, not exactly from DST but DST can't go around it since needs the auth from Steam to post the server on server list. All good now, if you are having the Steaminit problem check the solution I found.
 

 

Link to comment
Share on other sites

Im having the same trouble as GriffGlory... does anyone know a solution to this error:?

having problems with running the server itself it keeps saying:

Error: Missing /Users/(MacUser)/steamcmd directory!

and

/Users/(MacUser)/run_dedicated_servers.sh: line 21: cd: /Users/(MacUser)/steamcmd: No such file or directory

Please help

Link to comment
Share on other sites

17 hours ago, MonsterMonquey said:

Im having the same trouble as GriffGlory... does anyone know a solution to this error:?

having problems with running the server itself it keeps saying:

Error: Missing /Users/(MacUser)/steamcmd directory!

and

/Users/(MacUser)/run_dedicated_servers.sh: line 21: cd: /Users/(MacUser)/steamcmd: No such file or directory

Please help

Have you installed steamcmd as instructed in the first post?

I assume that's where you got the run_dedicated... script from. The error message means it's not finding the steamcmd directory. If you installed it elsewhere, you'll need to edit the script to reflect that.

If you installed steamcmd through something like homebrew, and your steamcmd launches from PATH (and don't want to have a copy dedicated for don't starve use), you'll need to edit the script significantly to work around the developers' assumptions.

Personally, I made my own script, so I can run whatever dedicated server I want without having to edit the file, but it does require that GNU screen is installed, and intentionally doesn't update mods on startup. See here.

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
 Share

×
  • Create New...