Setup a Server on Linux
1. Download authlib-injector
Section titled “1. Download authlib-injector”Download the latest version from the official github repo:
👉 https://github.com/yushijinhun/authlib-injector/releases
2. Place the JAR File
Section titled “2. Place the JAR File”Move the downloaded authlib-injector JAR file to a dedicated directory.
For example, store it in /opt/authlib-injector/:
mkdir -p /opt/authlib-injectormv authlib-injector.jar /opt/authlib-injector/3. Modify the Server Startup Command
Section titled “3. Modify the Server Startup Command”To use authlib-injector, modify the startup command for your Minecraft server.
Example Command for Paper/Spigot/Purpur:
Section titled “Example Command for Paper/Spigot/Purpur:”java -Xmx4G -Xms2G -javaagent:/opt/authlib-injector/authlib-injector.jar=https://authserver.visoftware.dev/authlib-injector -jar paper.jar noguiExample Command for Forge/Fabric:
Section titled “Example Command for Forge/Fabric:”java -Xmx4G -Xms2G -javaagent:/opt/authlib-injector/authlib-injector.jar=https://authserver.visoftware.dev/authlib-injector -jar fabric-server-launch.jar noguiExplanation:
Section titled “Explanation:”-Xmx4G: Sets the maximum memory allocation (adjust as needed).-Xms2G: Sets the minimum memory allocation (adjust as needed).-javaagent:/opt/authlib-injector/authlib-injector.jar=https://authserver.visoftware.dev/authlib-injector: Loads theauthlib-injectoras a Java agent and redirects authentication requests.-jar paper.jar: Starts the Minecraft server (replace with your actual server JAR file).nogui: Runs the server without the graphical user interface.
4. Automate the Startup (Optional)
Section titled “4. Automate the Startup (Optional)”To automate the startup process, you can create a startup script:
-
Create a new script file:
Terminal window nano start-minecraft.sh -
Add the following content:
#!/bin/bashjava -Xmx4G -Xms2G -javaagent:/opt/authlib-injector/authlib-injector.jar=https://authserver.visoftware.dev/authlib-injector -jar paper.jar nogui -
Save the file (
CTRL + X, thenY, thenEnter). -
Give it execute permissions:
Terminal window chmod +x start-minecraft.sh -
Start your server using:
Terminal window ./start-minecraft.sh
5. Verify the Server is Using authlib-injector
Section titled “5. Verify the Server is Using authlib-injector”Check the server logs (authlib-injector.log or console output) for messages related to authlib-injector. If it’s working correctly, you should see output confirming that the authentication system is redirected.