Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Server Install/Linux: Difference between revisions

From Vault Hunters Official Wiki
mNo edit summary
mNo edit summary
 
(8 intermediate revisions by the same user not shown)
Line 4: Line 4:
             <li>{{Hidden
             <li>{{Hidden
                 | Ubuntu/Debian
                 | Ubuntu/Debian
                 |<pre>
                 |<pre>sudo apt update
                sudo apt update
sudo apt install openjdk-17-jdk
                sudo apt install openjdk-17-jdk
java --version </pre>
                java --version
                }}</li>
                </pre>}}
            </li>
             <li>{{Hidden
             <li>{{Hidden
                 | CentOS/RHEL/Fedora/Rocky
                 | CentOS/RHEL/Fedora/Rocky
                 |
                 |<pre>sudo dnf install java-17-openjdk-devel
                <pre>
java --version</pre>
                sudo dnf install java-17-openjdk-devel
                java --version
                </pre>
               }}</li>
               }}</li>
             <li>{{Hidden
             <li>{{Hidden
                 | MacOS (using Homebrew)
                 | MacOS (using Homebrew)
                 |
                 | <pre>brew install openjdk@17
                <pre>
java --version</pre>
                brew install openjdk@17
                java --version
                </pre>
               }}</li>
               }}</li>
             <li>{{Hidden
             <li>{{Hidden
                 | CentOS/RHEL/Fedora/Rocky
                 | CentOS/RHEL/Fedora/Rocky
                 |
                 | <pre> sudo dnf install java-17-openjdk-devel
                <pre>
java --version</pre>
                sudo dnf install java-17-openjdk-devel
                java --version
                </pre>
               }}</li>
               }}</li>
             <li>{{Hidden
             <li>{{Hidden
                 | FreeBSD/OpenBSD (via pkg)
                 | FreeBSD/OpenBSD (via pkg)
                 |
                 | <pre>pkg install openjdk17
                <pre>
java --version</pre>
                pkg install openjdk17
                java --version
                </pre>
               }}</li>
               }}</li>
             <li>If you followed the commands above, you should see an output similar the following, after running <code>java --version</code>
             <li>If you followed the commands above, you should see an output similar the following, after running <code>java --version</code>
Line 59: Line 45:
     </li>
     </li>


     <li>Download and Install Forge
     <li>Download the Recommended Version of Forge 1.18.2
         <ul>
         <ul>
             <li>TBD</li>
             <li><pre>wget https://maven.minecraftforge.net/net/minecraftforge/forge/1.18.2-[VERSION]/forge-1.18.2-[VERSION]-installer.jar</pre></li>
        </ul>
            {{Ambox
            | type=content
            | text=Replace <code>[VERSION]</code> in the jar filename with the actual Forge version number from your downloaded file.
            }}
            </ul>
     </li>
     </li>
     <li>Download Server Files
     <li>Download Server Files
         <ul>
         <ul>
             <li>Navigate to the [https://www.curseforge.com/minecraft/modpacks/vault-hunters-1-18-2 Vault Hunters CurseForge page]</li>
             <li>Navigate to the [https://www.curseforge.com/minecraft/modpacks/vault-hunters-1-18-2 Vault Hunters CurseForge page]</li>
             <li>Go to the "Files" tab</li>
             <li>Go to the "Files" tab</li>
             <li>Find version '''3.18.3'''</li>
             <li>Find the latest version</li>
             <li>Click on the version to view details</li>
             <li>Click on the version to view details</li>
             <li>In the "Additional Files" section, download the '''Server Pack'''</li>
             <li>In the "Additional Files" section, download the '''Server Files Pack'''</li>
             <li>Extract the server files to your server directory</li>
             <li>Extract the server files to your server directory</li>
         </ul>
         </ul>
     </li>
     </li>
     <li>Create Start Script
     <li>Create Start Script
         <ul>
         <ul>
             <li>Create a file named <code>start.sh</code> in your server directory:</li>
             <li>Create a file named <code>start.sh</code> in your server directory:</li>
             <li><pre>TBD</pre></li>
                <syntaxhighlight lang="bash" line>local unwanted_mods=("legendarytooltips" "torohealth" "rubidium")
    for mod_pattern in "${unwanted_mods[@]}"; do
        if ls mods/*$mod_pattern* >/dev/null 2>&1; then
            rm -f mods/*$mod_pattern*
        fi
    done
 
    local restart_count=0
    while true; do
        # Build JVM arguments
        local args=()
       
        # Add custom JVM args if specified
        if [ -n "$JVM_ARGS" ]; then
             read -ra jvm_args_array <<< "$JVM_ARGS"
            args+=("${jvm_args_array[@]}")
        fi
       
        # Add user JVM args if file exists
        if [ -f "user_jvm_args.txt" ]; then
            while IFS= read -r line; do
                if [[ "$line" =~ ^-.*$ ]]; then
                    args+=("$line")
                fi
            done < "user_jvm_args.txt"
        fi
       
        # Use unix_args.txt instead of win_args.txt on Unix systems
        local args_file="libraries/net/minecraftforge/forge/1.18.2-$FORGE_VERSION/unix_args.txt"
        if [ ! -f "$args_file" ]; then
            # Fallback to win_args.txt if unix_args.txt doesn't exist
            args_file="libraries/net/minecraftforge/forge/1.18.2-$FORGE_VERSION/win_args.txt"
        fi
       
        args+=("@$args_file")
        args+=("nogui")
 
        # Start server
        "$JAVA_FILE" "${args[@]}"
 
        # Check for restart conditions
        if [ "$VH3_RESTART" = "true" ] && [ -f "logs/latest.log" ]; then
            if ! grep -q "Stopping the server" "logs/latest.log"; then
                restart_count=$((restart_count + 1))
                if [ $restart_count -le 10 ]; then
                    print_color $YELLOW "Restarting automatically in 10 seconds (press Ctrl + C to cancel)"
                    sleep 10
                    continue
                fi
            fi
        fi
        break
    done</syntaxhighlight>
         </ul>
         </ul>
     </li>
     </li>
</ol>
</ol>
'''Important''': Replace <code>[version]</code> in the jar filename with the actual Forge version number from your downloaded files.
<ol start="6">
<ol start="6">
     <li>Initial Server Setup
     <li>Initial Server Setup
Line 95: Line 132:
             </li>
             </li>
             <li>The server will create necessary files and then stop</li>
             <li>The server will create necessary files and then stop</li>
             <li>Edit <code>eula.txt</code> and change <code>eula=false</code> to <code>eula=true</code>:
             <li>Edit <code>eula.txt</code> and change <code>eula=false</code> to <code>eula=true</code>:</li>
                <ul>
                <pre>nano eula.txt</pre>
                    <li>nano eula.txt</li>
             <li>Optionally, edit <code>server.properties</code> to configure server settings:</li>
                </ul>
                <pre>nano server.properties</pre>
            </li>
        </ul>
             <li>Optionally, edit <code>server.properties</code> to configure server settings:
                <ul>
                    <li>nano server.properties</li>
                </ul>
            </li>
        </ul>
     </li>
     </li>
     <li>Start Your Server
     <li>Start Your Server
         <ul>
         <ul>

Latest revision as of 01:34, 22 July 2025

  1. Install Java 17
    • Ubuntu/Debian
      sudo apt update
      sudo apt install openjdk-17-jdk
      java --version 
    • CentOS/RHEL/Fedora/Rocky
      sudo dnf install java-17-openjdk-devel
      java --version
    • MacOS (using Homebrew)
      brew install openjdk@17
      java --version
    • CentOS/RHEL/Fedora/Rocky
       sudo dnf install java-17-openjdk-devel
      java --version
    • FreeBSD/OpenBSD (via pkg)
      pkg install openjdk17
      java --version
    • If you followed the commands above, you should see an output similar the following, after running java --version
      • openjdk version "17.0.12" 2024-07-16 LTS
        OpenJDK Runtime Environment Microsoft-9889599 (build 17.0.12+7-LTS)
        OpenJDK 64-Bit Server VM Microsoft-9889599 (build 17.0.12+7-LTS, mixed mode, sharing)
  2. Create Server Directory
    • mkdir ~/VaultHunters-Server
      cd ~/VaultHunters-Server
  3. Download the Recommended Version of Forge 1.18.2
    • wget https://maven.minecraftforge.net/net/minecraftforge/forge/1.18.2-[VERSION]/forge-1.18.2-[VERSION]-installer.jar

  4. Download Server Files
    • Navigate to the Vault Hunters CurseForge page
    • Go to the "Files" tab
    • Find the latest version
    • Click on the version to view details
    • In the "Additional Files" section, download the Server Files Pack
    • Extract the server files to your server directory
  5. Create Start Script
    • Create a file named start.sh in your server directory:
    • local unwanted_mods=("legendarytooltips" "torohealth" "rubidium")
          for mod_pattern in "${unwanted_mods[@]}"; do
              if ls mods/*$mod_pattern* >/dev/null 2>&1; then
                  rm -f mods/*$mod_pattern*
              fi
          done
      
          local restart_count=0
          while true; do
              # Build JVM arguments
              local args=()
              
              # Add custom JVM args if specified
              if [ -n "$JVM_ARGS" ]; then
                  read -ra jvm_args_array <<< "$JVM_ARGS"
                  args+=("${jvm_args_array[@]}")
              fi
              
              # Add user JVM args if file exists
              if [ -f "user_jvm_args.txt" ]; then
                  while IFS= read -r line; do
                      if [[ "$line" =~ ^-.*$ ]]; then
                          args+=("$line")
                      fi
                  done < "user_jvm_args.txt"
              fi
              
              # Use unix_args.txt instead of win_args.txt on Unix systems
              local args_file="libraries/net/minecraftforge/forge/1.18.2-$FORGE_VERSION/unix_args.txt"
              if [ ! -f "$args_file" ]; then
                  # Fallback to win_args.txt if unix_args.txt doesn't exist
                  args_file="libraries/net/minecraftforge/forge/1.18.2-$FORGE_VERSION/win_args.txt"
              fi
              
              args+=("@$args_file")
              args+=("nogui")
      
              # Start server
              "$JAVA_FILE" "${args[@]}"
      
              # Check for restart conditions
              if [ "$VH3_RESTART" = "true" ] && [ -f "logs/latest.log" ]; then
                  if ! grep -q "Stopping the server" "logs/latest.log"; then
                      restart_count=$((restart_count + 1))
                      if [ $restart_count -le 10 ]; then
                          print_color $YELLOW "Restarting automatically in 10 seconds (press Ctrl + C to cancel)"
                          sleep 10
                          continue
                      fi
                  fi
              fi
              break
          done
      
  1. Initial Server Setup
    • Run the server for the first time:
      • ./start.sh
    • The server will create necessary files and then stop
    • Edit eula.txt and change eula=false to eula=true:
    nano eula.txt
  2. Optionally, edit server.properties to configure server settings:
  3. nano server.properties
  4. Start Your Server
    • Execute ./start.sh to start your server. First startup may take several minutes as Forge loads all mods.