Tutorial: How to Create a Minecraft Server on a VPS

1. Getting a VPS

Before you begin, you need to get a VPS. I recommend using HostMF services, which offer VPS with support for Windows and Linux.

  • Go to HostMF.
  • Choose a VPS plan that meets the needs of your Minecraft server (I recommend at least 4 GB of RAM for a basic server).
  • Complete the purchase process and obtain the access details for your VPS.

2. Configuring the VPS

Accessing the VPS

Depending on the operating system you chose (Windows or Linux), you can connect to your VPS in different ways.

  • Windows: Use the Remote Desktop Protocol (RDP). On Windows, open the "Remote Desktop Connection", enter the IP address of your VPS and connect with the provided credentials.
  • Linux: Use SSH. In the terminal, type:
    ssh root@seu_ip_vps
    
    Enter the provided password.
Installing Java

The Minecraft Server requires Java to run.

  • For Linux:

    sudo apt update
    sudo apt install openjdk-17-jdk -y
    
  • For Windows: Download and install the Java Development Kit (JDK) from the official Oracle website.

3. Downloading and Configuring the Minecraft Server

Linux
  1. Create a directory for the Minecraft server:

    mkdir ~/minecraft-server
    cd ~/minecraft-server
    
  2. Download the Minecraft server file:

    wget https://launcher.mojang.com/v1/objects/f0ed079c0c7bde96b968a1a720eafbe3212a8d85/server.jar -O minecraft_server.1.19.2.jar
    
  3. Accept the EULA:

    echo "eula=true" > eula.txt
    
  4. Start the server:

    java -Xmx1024M -Xms1024M -jar minecraft_server.1.19.2.jar nogui
    
Windows
  1. Create a directory for the Minecraft server (for example, C:\minecraft-server).

  2. Download the Minecraft server file and save it in the directory you created.

  3. Accept the EULA:

    • Create an eula.txt file in the same server directory with the content:
      eula=true
      
  4. Start the server:

    • Open the command prompt (cmd) and navigate to the server directory:
      cd C:\minecraft-server
      
    • Run the server:
      java -Xmx1024M -Xms1024M -jar minecraft_server.1.19.2.jar nogui
      

4. Configuring the Server

After the first run, the server will generate configuration files. Edit server.properties to adjust the server settings (for example, the maximum number of players, the welcome message, etc.).

5. Accessing the Minecraft Server

Share the IP address of the VPS with players. They can connect to your Minecraft server using this IP.

6. Additional Security (Optional)

  • Linux: Consider configuring iptables or ufw to protect the server.

    sudo ufw allow 25565/tcp
    sudo ufw enable
    
  • Windows: Use the Windows Firewall to allow connections on port 25565.

7. Keeping the Server Updated

Always check for updates to the Minecraft server and the operating system to ensure everything stays secure and working properly.

Conclusion

Congratulations! You now have a Minecraft server running on a VPS. Take the opportunity to explore the many modding and plugin options available to further customize your gaming experience.

Was this answer helpful? 196 Users Found This Useful (680 Votes)