jammsen / docker-sons-of-the-forest-dedicated-server

Docker container to easily provision and manage Sons of the Forest Dedicated Server with Wine
https://hub.docker.com/r/jammsen/sons-of-the-forest-dedicated-server
136 stars 20 forks source link

A more detailed install description needed #33

Closed heusmich closed 1 day ago

heusmich commented 10 months ago

Have you read the Important information text above

Current behavior

Hi,

in my opinion the currently provided guideline is not easy to understand for Docker beginners so I don´t know how this container should be downloaded and installed. I don´t really have a lot of knowledge in Docker (and I also think a lot of others also don´t have) and it would help us to know how to install and use your Docker file.

Desired behavior

I would love to have a more detailed step by step guideline for the installation and activation of this SotF Docker container. For example on this site (https://github.com/mschnitzer/ark-survival-ascended-linux-container-image#installation) you can see that there is a very good step by step guideline which makes it easy for Docker beginners like me to understand what is needed and which steps have to be done after another.

Links to screenshots

No response

To Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Software setup

Hardware setup

Additional context

No response

gitzec commented 10 months ago

It is as easy as this:

  1. Install Docker and docker-compose (root needed)
  2. create a folder in your home dir like docker-sotf. You may use root for this also. Make these folders chmod 777
  3. change into it and create the docker-compose.yml from the readme in it. 🆕 then create these folder in this folder: steamcmd, game and winedata (the compose file uses these)
  4. execute docker-compose up once until the server is up and running (100%)
  5. press ctrl+c to shut down the composition
  6. find the serverconfig file and change it as you like
  7. start the composition again with docker-compose up -d (to detach from it and let it run in the background)
  8. play

whenever your server gets buggy (i never had this, it ran for days without issues):

  1. cd into the folder docker-sotf (it contains the compose file)
  2. docker-compose down && docker-compose up -d OR 🆕 (not recommended by the owner of this repo) docker-compose restart

Depends on what you prefer: Running it only while you use it (start/stop) or just restart it because it got buggy or you want it to be updated.

Edit:

IMHO...

heusmich commented 10 months ago

It is as easy as this:

1. Install Docker and docker-compose

2. create a folder in your home dir like `docker-sotf`

3. change into it and create the `docker-compose.yml` from the readme in it

4. execute `docker-compose up` once until the server is up and running (100%)

5. press ctrl+c to shut down the composition

6. find the serverconfig file and change it as you like

7. start the composition again with `docker-compose up -d` (to detach from it and let it run in the background)

8. play

whenever your server gets buggy (i never had this, it ran for days without issues):

1. cd into the folder with the compose file

2. `docker-compose down && docker-compose up -d` OR `docker-compose restart`

Depends on what you prefer: Running it only while you use it (start/stop) or just restart it because it got buggy or you want it to be updated.

Hi,

Thanks for your reply but I still have some questions to your answers:

  1. To your 2nd step, with which user should I create this dir? I think root is not recommend, so I need to add a new user, add this user to the sudoers list and create the folder with this user, right?
  2. To your 3rd step, what exactly do you mean with this point? How can I create the docker-compose.yml from the readme file? Do you mean just create the file and then copy this content from the website to the file?
    version: '3.9'
    services:
    sons-of-the-forest-dedicated-server:
    container_name: sons-of-the-forest-dedicated-server
    image: jammsen/sons-of-the-forest-dedicated-server:latest
    restart: always
    environment:
      ALWAYS_UPDATE_ON_START: 1
    ports:
      - 8766:8766/udp
      - 27016:27016/udp
      - 9700:9700/udp
    volumes:
      - ./steamcmd:/steamcmd
      - ./game:/sonsoftheforest
      - ./winedata:/winedata
  3. To your 6th point, where will this config be saved?

Thanks in advance for your help! :)

jammsen commented 10 months ago

Again im open to update the docs and dont want to be a hardass but it has to make sense.

I had a look but havent had time to commit to reading the link you provided ( https://github.com/mschnitzer/ark-survival-ascended-linux-container-image#installation ) - I hope i can do it on the weekend.

Reading your questions it feels like you either didnt read this or cant deliver on the minimum requirements: https://github.com/jammsen/docker-sons-of-the-forest-dedicated-server/tree/master#what-you-need-to-run-this It states "What you need to run this - Basic understanding of Docker, Linux and Networking (Port-Forwarding/NAT)" Which means understand Docker/Docker-Compose and understand Linux enough to read shell-scripts.

To your questions:

Hi,

Thanks for your reply but I still have some questions to your answers:

  1. To your 2nd step, with which user should I create this dir? I think root is not recommend, so I need to add a new user, add this user to the sudoers list and create the folder with this user, right?
  2. To your 3rd step, what exactly do you mean with this point? How can I create the docker-compose.yml from the readme file? Do you mean just create the file and then copy this content from the website to the file?
version: '3.9'
services:
  sons-of-the-forest-dedicated-server:
    container_name: sons-of-the-forest-dedicated-server
    image: jammsen/sons-of-the-forest-dedicated-server:latest
    restart: always
    environment:
      ALWAYS_UPDATE_ON_START: 1
    ports:
      - 8766:8766/udp
      - 27016:27016/udp
      - 9700:9700/udp
    volumes:
      - ./steamcmd:/steamcmd
      - ./game:/sonsoftheforest
      - ./winedata:/winedata
  1. To your 6th point, where will this config be saved?

Thanks in advance for your help! :)

jammsen commented 10 months ago

It is as easy as this:

  1. Install Docker and docker-compose
  2. create a folder in your home dir like docker-sotf
  3. change into it and create the docker-compose.yml from the readme in it
  4. execute docker-compose up once until the server is up and running (100%)
  5. press ctrl+c to shut down the composition
  6. find the serverconfig file and change it as you like
  7. start the composition again with docker-compose up -d (to detach from it and let it run in the background)
  8. play

whenever your server gets buggy (i never had this, it ran for days without issues):

  1. cd into the folder with the compose file
  2. docker-compose down && docker-compose up -d OR docker-compose restart

Depends on what you prefer: Running it only while you use it (start/stop) or just restart it because it got buggy or you want it to be updated.

I like 3+4 very much - Checking if everything is working in foreground 👍 and then you go to hosting-service, very nice!

4+5+6 is missing the docker-compose down, if 7 should be working

Here is a tip with 7 from the first list and 1+2 in the second list, IF you want a tip: As someone who uses Wine a long time now in Docker, you should not use docker-compose restart always use docker-compose down && docker-compose up -d because sometimes Wine gets weird or you have problems in WINEDATA and it screws with everything and nothing is working until a fresh new start, its just sometimes chasing ghosts with Wine. It gets even weirder if you have to use the winetricks script, which i am glad to be away from now. But yeah try to avoid if possible to restart containers/container-networks where Wine is used, just reprovision it again and you start fresh with no bugs.

gitzec commented 10 months ago

@heusmich I edited my post to implement the results of the discussion so far. i cannot give more suggestions without knowing your system.

@jammsen I could write some docs if you want. Just lmk. To the wine topic: I defined sotf in a stack and just change the replication from 0->1->0 when me and my friends play on it. but once i forgot to scale it down it ran for two weeks and we were able to hop onto it with no issues.

jammsen commented 10 months ago

@jammsen I could write some docs if you want. Just lmk. To the wine topic: I defined sotf in a stack and just change the replication from 0->1->0 when me and my friends play on it. but once i forgot to scale it down it ran for two weeks and we were able to hop onto it with no issues.

Feel free to write something up, i dont have the time to scan the link and do that at the moment. Regarding Wine, good for you, isnt the experience i had before, maybe we finally covered every edge-case then. doubtfull-though

gitzec commented 10 months ago

Maybe turn on the wiki feature for this repo? Then we could add an FAQ or sth. like this? Alternatively we could add an ./INSTALL.md or alike...

jammsen commented 10 months ago

Ive never used that Wiki function, how would this help you? If you dont mind me asking.

gitzec commented 10 months ago

A wiki is a simple website which anyone you permit can edit. not like (code) files in the repo where you have to pull/push/commit/merge and all that stuff. just a simple online website with markup or a wysiwyg editor. Makes managing central info easier and it comes with a repo for free (turn it on in the features). if you want a test drive i could start an empty public repo and turn the wiki on in it.

please always ask all you like. i do the same ;-)

jammsen commented 9 months ago

@gitzec ive got finnaly around to read myself a little into the wiki, i setup the main page. Feel free to add something

gitzec commented 8 months ago

Hey Sebastian, I just can read the wiki. If you want me to add content I need more permissions I guess.

jammsen commented 8 months ago

Hey @gitzec - Sorry, could you please try again?

gitzec commented 8 months ago

That worked :-) Thanks for your trust. Let's find a way to connect eg. via Discord without publishing our account details...

jammsen commented 8 months ago

@gitzec you can just add me on Discord its the same username.

heusmich commented 7 months ago

Hi again,

I´m not sure if this problem exists since the 1.0 update for SotF because I didn´t play the game for a few weeks now or if this is caused by something else, but currently I can´t connect to the server anymore. It worked in the past. When I start the server with "docker-compose up, I can see that the server start stops with the following error message:

sons-of-the-forest-dedicated-server | #DSE [Self-Tests] [Networking] UDP GamePort [7798] is closed. Please fix and restart.

But I didn´t close any ports, I don´t have a firewall active or something similar. And my other game servers are running without any problem. I also don´t see the server ingame.

I searched in the closed issues here and I found the info that I could add "SkipNetworkAccessibilityTest": true, to the dedicatedserver.cfg file. I tried this and the server is really booting up after I added this to the config file and restarted the server. I can also see it ingame, I can select it, I get the password prompt but the connection doesn´t work, the connection attempt stops after a few seconds.

Do you have an idea what I could do to solve this? As mentioned in my initial post, it´s running on an Ubuntu 22.04 root server.

gitzec commented 7 months ago

Maybe the host activated a software firewall like ufw?

gitzec commented 7 months ago

Also, please use a dedicated issue next time.

heusmich commented 7 months ago

Maybe the host activated a software firewall like ufw?

Hi,

No, as I already mentioned I don´t have a firewall active. When I check the status of the UFW on my server it says that it´s inactive. So I don´t understand why it´s not working anymore. And currently I also have three other game servers active, one is "ARK - Survival Ascended" which is also setup with a Docker image and the others are "The Front" and "American Truck Simulator", which are both set up with LinuxGSM. All three are working without any problems.

jammsen commented 7 months ago

Hey @heusmich - DONT NECRO - Create a dedicated issue for your problem, this issue is about documentation, not about your problem!

jammsen commented 7 months ago

That worked :-) Thanks for your trust. Let's find a way to connect eg. via Discord without publishing our account details...

@gitzec you can just add me on Discord its the same username.

@gitzec - You can find my here on my Discord, feel free to join and DM me - https://github.com/jammsen/docker-palworld-dedicated-server?tab=readme-ov-file#docker---palworld-dedicated-server

bonsaibauer commented 6 months ago

is there any problem, when iam stop the docker container with "docker stop ...." and "docker start ..." for example to play another gameserver on docker basis? or is recommended to use commands like "docker compose down" and "docker compose up -d"?

jammsen commented 6 months ago

Hello @bonsaibauer - First off, dont ninja open issues, if you need help create your own issue! This question and answer is off-topic to this topic, helps no-one to reach this goal and now alerts all included in here via email, who didnt sign up for this, thats not okay! Dont do that!

Second, its recommended to use Docker-Compose.

contrid commented 6 months ago

Great repository, thank you very much for making this available. I made a video of how to do the setup https://www.youtube.com/watch?v=vqf8gYcZC5E

gitzec commented 5 months ago

Hey @contrid ,

Thanks for the great tutorial! I found it very helpful in understanding how to set up a game server.

Here are a couple of suggestions that might make the guide even better for beginners:

Overall, this is a valuable tutorial, and these suggestions aim to make it even more accessible and informative for beginners. Thanks again for sharing your knowledge!

p.s.: Later system updates can be done easily with these three lines (caution: reboots the server after updating):

sudo su
apt update && apt -y full-upgrade && apt -y autoremove
shutdown -r now
jammsen commented 5 months ago

Hey @contrid - I agree with @gitzec

I liked the video, that video gives a good baseline on what to do, but might miss a bit of context information you have in your thoughts, but dont verbalize.

Example, you git clone the repo, but iirc you never explain why you do that. You could have just used the "docker run" command and reached the same goal. But if you would like to build the image yourself OR use Docker-Compose this would make more sense, because now you have a current example config OR the shell-scripts to build yourself.

If your open to feedback on your video structure: Establish a baseline first - Explain in a headline/teaser what we will do - 3 Parts of todos - which you also can use to add "categories/timestamps" in the video, not sure how thats called in YT though. Steps: 1.) Setup an VM ( Go through AWS, the login and how to get the ip ) 2.) Setup the tools we need ( Install Docker, set it up on a systemlevel and do ufw setup ) 3.) Explain the that now the dedicated server follows and go through that steps, including setting up firewall rules, for learning that, when i want to host 2 servers, i need 2 sets of 3 ports. I feel like that this gives your video more structure and a rough baseline for "new users" to structure things, follow it and then understand. After undestanding the mind is more open to improve the learning and things.

I also liked that you left out that the server normally is Windows only and now its running under Linux in Docker with Wine, which would confuse people on a newer level.

contrid commented 5 months ago

@jammsen Hey thanks for the feedback and for the amazing tool you created.

The purpose of the video tutorial was to showcase how quick and easy it is - 7 minutes to setup a working and running Sons of The Forest dedicated server - without going into too much detail and just the needed parts 😁👍

I will definitely share more knowledge on other areas as I use it and I hope other people do too. The game is very cool, I enjoy it so I will definitely be using this tool more. Thanks again!

gitzec commented 3 months ago

Noone like open issues... I just added some info to the wiki page. :-)

jammsen commented 3 months ago

Noone like open issues... I just added some info to the wiki page. :-)

Just read your guide: 2 Feedback-Points: 1.) I would leave out the Debian/Ubuntu Install out of the Wiki, thats a point which will contstantly change, so i would just do a link and leave it open to the pros at this, who created automated documentation about their product for this. Its a constant point of care and in a wiki you dont want to change something everything someone else changes something. 2.) In the setup part you talk about installing as root but using it as user "x" but im missing the "usermod -aG X docker" command to make sure the user is part of the docker group, which would be in the official documentation. Without that the user cant use docker.

For the rest, i like it!

gitzec commented 3 months ago

Yay, thanks for the feedback.

Regarding...

  1. It is not really an install description. Just how to keep the system up to date which is needed to have it compatible with docker and finally with your image...
  2. This is being discussed a lot... Put users in the docker group or use sudo as in my examples... But, I will just change it for composition control... 🙂
jammsen commented 3 months ago
  1. It is not really an install description. Just how to keep the system up to date which is needed to have it compatible with docker and finally with your image...

Oh so its not your intend to doublicate content from Docker? Because it read that way, maybe rephrase it a little then? 😄

gitzec commented 3 months ago

Ah, now I get it... You mean the docker install process is just copy paste of the content they host at the moment. It may change and then we are outdated. Just a link would make sure to have the reader always read most up to date content...?

Imho I extracted only the neccessary steps needed to get this image up and running without all the different other possible approaches from their docs ... This way a new server host finds all steps in here. I will update this page on demand to make sure we are up to date. 😃👍

jammsen commented 3 months ago

Seems like a lot of work for less to no value, but if you want that, feel free.

jogerj commented 2 months ago

Notes for Windows (WSL2), mounting directories from an NTFS drive won't work (as mentioned https://github.com/jammsen/docker-sons-of-the-forest-dedicated-server/issues/28#issuecomment-1834590873) as this breaks Wine and steamcmd

solution: create docker volumes and mount them

services:
  sons-of-the-forest-dedicated-server:
    container_name: sons-of-the-forest-dedicated-server
    image: jammsen/sons-of-the-forest-dedicated-server:latest
    # restart: always
    restart: unless-stopped # allows stopping container on demand
    environment:
      ALWAYS_UPDATE_ON_START: 1
    ports:
      - 8766:8766/udp
      - 27016:27016/udp
      - 9700:9700/udp
    volumes:
      - sotf-steamcmd:/steamcmd
      - sotf-game:/sonsoftheforest
      - sotf-winedata:/winedata
      # uncomment to mount custom configs (without generating new one)
      # - path/to/ownerswhitelist.txt:/sonsoftheforest/userdata/ownerswhitelist.txt
      # optionally add read-only flag
      # - path/to/dedicatedserver.cfg:/sonsoftheforest/userdata/dedicatedserver.cfg:ro
volumes:
    sotf-steamcmd:
    sotf-game:
    sotf-winedata:
jammsen commented 2 months ago

Notes for Windows (WSL2), mounting directories from an NTFS drive won't work (as mentioned #28 (comment)) as this breaks Wine and steamcmd

solution: create docker volumes and mount them

services:
  sons-of-the-forest-dedicated-server:
    container_name: sons-of-the-forest-dedicated-server
    image: jammsen/sons-of-the-forest-dedicated-server:latest
    # restart: always
    restart: unless-stopped # allows stopping container on demand
    environment:
      ALWAYS_UPDATE_ON_START: 1
    ports:
      - 8766:8766/udp
      - 27016:27016/udp
      - 9700:9700/udp
    volumes:
      - sotf-steamcmd:/steamcmd
      - sotf-game:/sonsoftheforest
      - sotf-winedata:/winedata
      # uncomment to mount custom configs (without generating new one)
      # - path/to/ownerswhitelist.txt:/sonsoftheforest/userdata/ownerswhitelist.txt
      # optionally add read-only flag
      # - path/to/dedicatedserver.cfg:/sonsoftheforest/userdata/dedicatedserver.cfg:ro
volumes:
    sotf-steamcmd:
    sotf-game:
    sotf-winedata:

Yeah normally WSL2 with Docker is solid there, but when you integrated NFS/NTFS/SMB in the mix things start to break and get weird REALLY FAST. Going for the Volume option then and do maybe manual syncs or so sounds better.