Page namespace (page_namespace) | 0 |
Page title (without namespace) (page_title) | 'Multiplayer-Linux' |
Full page title (page_prefixedtitle) | 'Multiplayer-Linux' |
Old content model (old_content_model) | 'wikitext' |
New content model (new_content_model) | 'wikitext' |
Old page wikitext, before the edit (old_wikitext) | '=== Linux Dedicated Server Setup Instructions ===
Instructions for setting up a dedicated server on a Debian based distribution.
We will be using SteamCMD to install and update the server.
Install steamCMD dependencies using the commands below, either as root or a user with sudo privileges.
<pre>sudo dpkg --add-architecture i386 \
sudo apt update \
sudo apt install -y lib32gcc1 \
sudo apt install -y lib32gcc-s1</pre>
Create the user who will run the server.
<code>sudo useradd --create-home necesse </code>
Change to the necesse user and go to it's home directory, where we will be installing steam and the server files.
<code>su - necesse ; cd /home/necesse</code>
Then download and unzip SteamCMD
<code>curl -sqL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | tar zxvf -</code>
Create the configuration file that will manage steamCMD
<pre>
cat >$HOME/update_necesse.txt <<'EOL'
@ShutdownOnFailedCommand 1 //Set to 0 if updating more than one server.
@NoPromptForPassword 1
force_install_dir /home/necesse/
login anonymous // Necesse dedicated server is available as anonymous. Thank you Fair!
app_update 1169370 validate
quit
EOL
</pre>
Run steamCMD and point it at the config file to install and update the server.
<code>./home/necesse/steamcmd.sh +runscript $HOME/update_necesse.txt</code>
This will take a few minutes. SteamCMD will first update itself, then download the server files.
This command will also update the server files. Either run it as a cron job or manually as needed.
You can now start the Necesse server with
<code>./StartServer-nogui.sh</code>
You will have to answer a few questions each time the server launches.
To start the server with no interaction, use the -world [Save name] Argument.
Example:
<code>./StartServer-nogui.sh -world SaveGame1</code>
== Ports ==
Default port is, '''14159'''
You will need to do port forwarding and find your IP address to give to friends. There is already a write-up about this on the wiki.
==File Locations==
By default
The server configuration file is named "server.cfg" and is located at <code>~/.config/Necesse/cfg</code>
The world configuration file is named "worldSettings.cfg" and is located at <code>~/.config/Necesse/saves/YourWorldNamehere.zip</code>
The save data is the .zip named according to the world name, and is located at <code>~/.config/Necesse/saves</code>
The server logs are found at <code>~/.config/Necesse/logs</code>
You can also force configs to the game directory with the -localdir parameter in the shell script file.
Example:
<code>./StartServer-nogui.sh -localdir</code>' |
New page wikitext, after the edit (new_wikitext) | '=== Linux Dedicated Server Setup Instructions ===
Instructions for setting up a dedicated server on a Debian based distribution.
We will be using SteamCMD to install and update the server.
Install steamCMD dependencies using the commands below, either as root or a user with sudo privileges.
<pre>sudo dpkg --add-architecture i386 \
sudo apt update \
sudo apt install -y lib32gcc1 \
sudo apt install -y lib32gcc-s1</pre>
Create the user who will run the server.
<code>sudo useradd --create-home necesse </code>
Change to the necesse user and go to it's home directory, where we will be installing steam and the server files.
<code>su - necesse ; cd /home/necesse</code>
Then download and unzip SteamCMD
<code>curl -sqL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | tar zxvf -</code>
Create the configuration file that will manage steamCMD
<pre>
cat >$HOME/update_necesse.txt <<'EOL'
@ShutdownOnFailedCommand 1 //Set to 0 if updating more than one server.
@NoPromptForPassword 1
force_install_dir /home/necesse/
login anonymous // Necesse dedicated server is available as anonymous. Thank you Fair!
app_update 1169370 validate
quit
EOL
</pre>
Run steamCMD and point it at the config file to install and update the server.
<code>./home/necesse/steamcmd.sh +runscript $HOME/update_necesse.txt</code>
This will take a few minutes. SteamCMD will first update itself, then download the server files.
This command will also update the server files. Either run it as a cron job or manually as needed.
You can now start the Necesse server with
<code>./StartServer-nogui.sh</code>
You will have to answer a few questions each time the server launches.
To start the server with no interaction, use the -world [Save name] Argument.
Example:
<code>./StartServer-nogui.sh -world SaveGame1</code>
== Ports ==
Default port is, '''14159'''
You will need to do port forwarding and find your IP address to give to friends. There is already a write-up about this on the wiki.
==File Locations==
By default
The server configuration file is named "server.cfg" and is located at <code>~/.config/Necesse/cfg</code>
The world configuration file is named "worldSettings.cfg" and is located at <code>~/.config/Necesse/saves/YourWorldNamehere.zip</code>
The save data is the .zip named according to the world name, and is located at <code>~/.config/Necesse/saves</code>
The server logs are found at <code>~/.config/Necesse/logs</code>
You can also force configs to the game directory with the -localdir parameter in the shell script file.
Example:
<code>./StartServer-nogui.sh -localdir</code>
==Docker instructions==
Running Necesse using Docker is also possible.
Create a Dockerfile in an empty directory:
<pre>
# Use a base image
FROM debian:bullseye-slim
# Add user 'necesse', don't run stuff as root!!
ARG user=necesse
ARG group=necesse
ARG uid=1000
ARG gid=1000
RUN groupadd -g ${gid} ${group}
RUN useradd -u ${uid} -g ${group} -s /bin/bash -m ${user}
RUN dpkg --add-architecture i386
RUN apt update; apt install -y lib32gcc-s1 curl openjdk-17-jre-headless
# Download and extract SteamCMD
RUN mkdir -p /steamapps
RUN curl -sqL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | tar zxvf - -C /steamapps
WORKDIR /steamapps
# Create the update_necesse.txt file
RUN echo '@ShutdownOnFailedCommand 1' >> update_necesse.txt \
&& echo '@NoPromptForPassword 1' >> update_necesse.txt \
&& echo 'force_install_dir /app/' >> update_necesse.txt \
&& echo 'login anonymous' >> update_necesse.txt \
&& echo 'app_update 1169370 validate' >> update_necesse.txt \
&& echo 'quit' >> update_necesse.txt
RUN echo $(date) && ./steamcmd.sh +runscript update_necesse.txt
# Saves will be available under /root/.config/Necesse/saves
RUN chown -R 1000:1000 /app
RUN chown -R 1000:1000 /home/necesse
USER ${uid}:${gid}
# Set the working directory and create entrypoint.sh
WORKDIR /app
RUN echo '#!/bin/sh' > entrypoint.sh && \
echo 'java -jar Server.jar -nogui -world "$WORLD_NAME"' >> entrypoint.sh && \
chmod +x entrypoint.sh
# Set the entry point for the container
CMD ["./entrypoint.sh"]
</pre>
Build the image:
<pre>
docker build -t necesse .
</pre>
Now run the container interactively once to create a world:
<pre>
docker run --rm -it -v necesse_data:/home/necesse.config/Necesse necesse java -jar Server.jar -nogui
</pre>
Please remember the world name!
Now you can run the docker forever, create a file called '''start_necesse.sh''' and make it executable by running '''chmod +x start_necesse.sh''':
<pre>
docker stop necesse
docker rm necesse
docker build -t necesse .
docker run -d --name necesse \
-e WORLD_NAME=my_world\
-p 14159:14159/udp \
-v ./data:/home/necesse/.config/Necesse \
--restart always \
necesse
</pre>
If there is an update you can run '''start_necesse.sh''' again and it will update to the latest version available on Steam and automatically start.' |
Lines added in edit (added_lines) | [
0 => '',
1 => '==Docker instructions==',
2 => 'Running Necesse using Docker is also possible.',
3 => '',
4 => 'Create a Dockerfile in an empty directory:',
5 => '',
6 => '<pre>',
7 => '# Use a base image',
8 => 'FROM debian:bullseye-slim',
9 => '',
10 => '# Add user 'necesse', don't run stuff as root!!',
11 => 'ARG user=necesse',
12 => 'ARG group=necesse',
13 => 'ARG uid=1000',
14 => 'ARG gid=1000',
15 => '',
16 => 'RUN groupadd -g ${gid} ${group}',
17 => 'RUN useradd -u ${uid} -g ${group} -s /bin/bash -m ${user}',
18 => '',
19 => 'RUN dpkg --add-architecture i386',
20 => 'RUN apt update; apt install -y lib32gcc-s1 curl openjdk-17-jre-headless',
21 => '',
22 => '# Download and extract SteamCMD',
23 => 'RUN mkdir -p /steamapps',
24 => 'RUN curl -sqL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | tar zxvf - -C /steamapps',
25 => 'WORKDIR /steamapps',
26 => '',
27 => '# Create the update_necesse.txt file',
28 => 'RUN echo '@ShutdownOnFailedCommand 1' >> update_necesse.txt \',
29 => ' && echo '@NoPromptForPassword 1' >> update_necesse.txt \',
30 => ' && echo 'force_install_dir /app/' >> update_necesse.txt \',
31 => ' && echo 'login anonymous' >> update_necesse.txt \',
32 => ' && echo 'app_update 1169370 validate' >> update_necesse.txt \',
33 => ' && echo 'quit' >> update_necesse.txt',
34 => '',
35 => 'RUN echo $(date) && ./steamcmd.sh +runscript update_necesse.txt',
36 => '',
37 => '# Saves will be available under /root/.config/Necesse/saves',
38 => 'RUN chown -R 1000:1000 /app',
39 => 'RUN chown -R 1000:1000 /home/necesse',
40 => '',
41 => 'USER ${uid}:${gid}',
42 => '',
43 => '# Set the working directory and create entrypoint.sh',
44 => 'WORKDIR /app',
45 => 'RUN echo '#!/bin/sh' > entrypoint.sh && \',
46 => ' echo 'java -jar Server.jar -nogui -world "$WORLD_NAME"' >> entrypoint.sh && \',
47 => ' chmod +x entrypoint.sh',
48 => '',
49 => '# Set the entry point for the container',
50 => 'CMD ["./entrypoint.sh"]',
51 => '</pre>',
52 => '',
53 => 'Build the image:',
54 => '<pre>',
55 => 'docker build -t necesse .',
56 => '</pre>',
57 => '',
58 => 'Now run the container interactively once to create a world:',
59 => '<pre>',
60 => 'docker run --rm -it -v necesse_data:/home/necesse.config/Necesse necesse java -jar Server.jar -nogui',
61 => '</pre>',
62 => 'Please remember the world name!',
63 => '',
64 => 'Now you can run the docker forever, create a file called '''start_necesse.sh''' and make it executable by running '''chmod +x start_necesse.sh''':',
65 => '<pre>',
66 => 'docker stop necesse',
67 => 'docker rm necesse',
68 => 'docker build -t necesse .',
69 => 'docker run -d --name necesse \',
70 => ' -e WORLD_NAME=my_world\',
71 => ' -p 14159:14159/udp \',
72 => ' -v ./data:/home/necesse/.config/Necesse \',
73 => ' --restart always \',
74 => ' necesse',
75 => '</pre>',
76 => '',
77 => 'If there is an update you can run '''start_necesse.sh''' again and it will update to the latest version available on Steam and automatically start.'
] |