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
Line 51: Line 51:
             | type=content
             | type=content
             | text=Replace <code>[VERSION]</code> in the jar filename with the actual Forge version number from your downloaded file.
             | text=Replace <code>[VERSION]</code> in the jar filename with the actual Forge version number from your downloaded file.
             }}
             }}</ul>
        </ul>
     </li>
     </li>
     <li>Download Server Files
     <li>Download Server Files

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.