How to Setup a Minecraft Forge Server on a VPS

How to Setup a Minecraft Forge Server on a VPS (head image)

Minecraft fans are always looking for ways to make their gaming experience better, and one game-changing option is setting up a Forge server on a Virtual Private Server (VPS). This guide will take you through the steps of setting up a Minecraft Forge Server on a VPS, covering all the necessary prerequisites to ensure a smooth and hassle-free setup. 

Preparing Your VPS

VPS Hosting Options

Before diving into the setup process, it is necessary to choose the right VPS hosting provider that aligns with your needs and budget. We recommend considering the Contabo VPS M SSD for its resources, making it ideal for hosting a Minecraft Forge server with mods and playing together with friends. 

Accessing Your VPS

Now that you have chosen your VPS, the next step is gaining access. This involves connecting to your server via SSH (Secure Shell). Refer to our article, “Establishing a connection to your server via SSH,” for a detailed guide. Additionally, it is necessary to log in as the root user, ensuring you have the necessary privileges. For insights into managing superuser accounts, sudo, and root access, check out our guide titled “A Practical Guide to Superuser Accounts, sudo & root.“Let us ensure a secure and empowered start to your Minecraft server journey. 

System Requirements and Optimization

Ensure your VPS meets the system requirements for hosting a Minecraft Forge server. Generally, a VPS with at least 2GB of RAM and a decent CPU is recommended. As mentioned above, our VPS M SSD meets these requirements with its 16 GBs of RAM and 6 CPU cores, offering a smooth gaming experience with mods and friends without emptying your pockets. 

Installing Other Minecraft Versions

While Forge is a fantastic choice for many, Minecraft offers a diverse range of experiences with different server versions. Here, we will briefly guide you to resources for installing Vanilla Minecraft and setting up a Spigot server on your VPS.  

How to Setup a Minecraft Server – The Ultimate Guide

If you are inclined towards the purity of Vanilla Minecraft, our comprehensive guide “How to Setup a Minecraft Server – The Ultimate Guide” walks you through the step-by-step process.  

How to Setup a Minecraft Forge Server on a VPS

For those who crave the excitement of modded gameplay, our guide on “Setting up a Minecraft Spigot server on a VPS” is your go-to resource.  

How to Install Forge on a Linux VPS (Pre-1.16, Manual)

Before diving into the Forge installation, let´s make sure your VPS is equipped with the required packages:  

Screen:  

Screen provides a virtual terminal session, allowing your Minecraft server to run in the background. Install it using:  

sudo apt-get update
sudo apt-get install screen

Learn more about Screen and how it works in our dedicated article called “What is Screen and How to use it on a VPS” 

Wget:  

Wget, a command-line utility, will help us download necessary files. Install it using:  

sudo apt-get install wget

Install Java 8

Different Minecraft versions may require specific Java versions.  

Minecraft Version Required Java Version 
1.7.10 – 1.16.5 Java 8 
1.17.x Java 16 
1.18+ Java 17 

For this Minecraft version, we will need to install Java 8, like below: 

sudo apt update
sudo apt install openjdk-8-jdk

Downloading and Installing Forge server

Now we need to download all the files needed to run your own Forge server. 

Start by creating a dedicated directory: 

mkdir forge_server

Now, navigate to the directory: 

cd forge_server

Finally, download the Forge server jar: 

wget <Forge-Server-URL>

Replace ” Forge-Server-URL“ with the actual domain of the version you want to download. The URLs can be found on the Forge official website. 

Install Forge-Server:

Now run the installer with 

java -jar [name_of_the_forge.jar] --installServer

Replace [name_of_the_forge.jar] with the actual name of the forge.jar you have just downloaded! 

Creating a Starting Script & Launching Server

Now, let us create a script with which we can start our Minecraft Forge server: 

First, create the script file with this command: 

nano start.sh

And paste in the following content 

#!/bin/bash 

screen -S Minecraft java -Xmx8G -Xms512M -jar [Name_of_forge.jar]

Save you changes with [CTRL] + [O] and exit the editor with [CTRL] + [X] 

Pro-Tip:  

If necessary, please modify:   

  • Xms for the minimum amount of RAM you want to allocate   
  • Xmx for the maximum number of RAM you want to allocate   

Now, let us make it executable with the help of this command: 

chmod +x start.sh

Quickly accept the EULA (End User License Agreement) by creating a file called “eula.txt” with this command: 

nano eula.txt

And paste in the following content: 

eula=true

Now save you changes with [CTRL] + [O] and exit the editor with [CTRL] + [X] 

It is finally time to launch the server: 

./start.sh

How to Install Minecraft Forge on a Linux VPS (1.16+, Manual)

Again, before diving into the Forge installation, ensure your VPS is equipped with the necessary tools. For this,  install required packages:  

Screen:  

Screen provides a virtual terminal session, allowing your Minecraft server to run in the background. Install it using:  

sudo apt-get update
sudo apt-get install screen

Wget:  

Wget, a command-line utility, will help us download necessary files. Install it using: 

sudo apt-get install wget

Install Java 17

Different Minecraft versions may require specific Java versions.  

Minecraft Version Required Java Version 
1.7.10 – 1.16.5 Java 8 
1.17.x Java 16 
1.18+ Java 17 

For this Minecraft version, we will need to install Java 17. 

sudo apt update
sudo apt-get install openjdk-17-jre-headless

Downloading and Installing Forge server

Now we need to download all the files needed to run your own Forge server. 

Start by creating a dedicated directory: 

mkdir forge_server

Now, navigate to the directory: 

cd forge_server

Finally, download the Forge server jar: 

wget <Forge-Server-URL>

Replace “Forge-Server-URL“ with the actual domain of the version you want to download. The URLs can be found on Forge’s official website. 

Install Forge-Server:

Now run the installer with 

java -jar [name_of_the_forge.jar] --installServer

Replace [name_of_the_forge.jar] with the actual name of the forge.jar you have just downloaded! 

Creating a Starting Script & Launching Server

Now, let us create a starting script with which we can start our Minecraft Forge server. 

And here is the main difference between Forge Pre-1.16 and now – The file structure. 

To change the amount of RAM that you want to allocate to your Minecraft Forge server, open the files called “user_jvm_args.txt” with this command: 

nano user_jvm_args.txt

To set the minimum & the maximum amount of RAM add these two lines: 

-Xms512M 

-Xmx8G

If necessary, please modify:   

  • Xms for the minimum amount of RAM you want to allocate   
  • Xmx for the maximum number of RAM you want to allocate   

Save you changes with [CTRL] + [O] and exit the editor with [CTRL] + [X] 

Now, let us create a start script. 

Let us use the template that the installer already created – But let us rename it with this command: 

mv run.sh start.sh

Now open the file with the nano-editor: 

nano start.sh

Now, add the following content in front of the content of the last line: 

After that it should look similar to this: 

screen -S Forge java @user_jvm_args.txt @libraries/net/minecraftforge/forge/1.20.1-47.2.1/unix_args.txt "$@" 

Please keep in mind that your forge version number may differ based on the version you have installed! 

Now, let us make it executable with the help of this command: 

chmod +x start.sh

Let us quickly accept the EULA by creating a file called “eula.txt” with this command: 

nano eula.txt

And paste in the following content: 

eula=true

Now save you changes with [CTRL] + [O] and exit the editor with [CTRL] + [X] 

It is finally time to launch the server: 

./start.sh

By using these commands, you will successfully install Forge on your Linux VPS, accommodating both older and newer Minecraft versions. In the next chapter, we will explore essential configurations to optimize your Forge server for the best gaming experience. 

Installing Forge through an Installer Script

This method is great for anyone who wants to set up their own Spigot server but found the steps above a bit tricky.  

We will use “mcserver_installer” by realTM – an open–source, powerful and extensive Bash-Script to install Minecraft servers on your Linux server.  

More information and the source-code of this project can be found on the official GitHub page here: https://github.com/officialrealTM/mcserver_installer  

Prerequisites/Requirements

  • A Linux server with a supported Linux distribution (Debian & Ubuntu) and enough resources (We recommend at least our VPS M SSD)   
  • Root & SSH Access to your Linux server   

Downloading the Script

 To download the script, the git-package needs to be installed on your server. To install it use:   

apt install git –y

Now download the script with this command:   

git clone https://github.com/officialrealTM/mcserver_installer.git  

Running the Minecraft Spigot Installer Script  

After downloading the script go into its directory with this command:   

cd mcserver_installer

And execute the script with this command:   

./mcserver_installer.sh

When starting the script for the first time, it wants to install some required packages. Hit “Yes” to continue.  

How to Setup a Minecraft Forge Server on a VPS (script inital startup)

This process can take a few moments to finish.  

After the initial setup process, the script will ask you which type of Minecraft server you want to install. From now on this will be the menu you will get every time you start the script.  

Select Server Type

How to Setup a Minecraft Forge Server on a VPS (script select server type)

As you can see, this script can install Minecraft Vanilla, Forge, Spigot and Paper servers. In this case we will go with “Minecraft Forge” – so we use the up and down keys to navigate to “Minecraft Forge” and hit enter to select it.  

Select the Major Version

Now it prompts us to select the major Minecraft version you want to run Spigot on:   

How to Setup a Minecraft Forge Server on a VPS (script select major minecraft version)

We will select the, as of today, newest version, which is 1.20 using the up and down keys again, followed by pressing enter.  

Installation of Java 17

The script automatically detects that to run a Minecraft 1.20 server, Java 17 is required and asks you if you want to install it:   

Script: Install Java 17 on a VPS

Hit “Yes” to install it. This process will take a few moments to finish.  

Select the Subversion

In the next screen you will be able to select the exact subversion:  

Script: Select Minecraft Subversion

In this case, for Minecraft Spigot 1.20 there are only two subversions available, 1.20 and 1.20.1. Confirm your entry by pressing enter again.

Enter Forge Build

Now you need to enter the exact Forge build number for the build you want to install: 

Script: Enter Forge Version

The build numbers can be found on the official Forge website

The build number for the latest build of Forge Minecraft 1.20.1 is “47.2.1”. 

So that is the number we will insert into the script: 

Confirm this by pressing enter again.  

Now all needed files will be downloaded, installed, and moved to their right positions. 

Set the RAM of the Minecraft Server

After the installation has finished, you can either select a pre-defined amount of RAM to allocate to your Minecraft server or set a custom amount.  

Script: Select RAM

Pro-Tip: If you do not want to run anything on the server except the Minecraft server, you can allocate up to 75% of the Linux server’s RAM. In this example, our VPS M SSD has 16GB of RAM, so we could allocate a maximum of 12GB of RAM to the server. If you want to run other things on your Linux server besides the Minecraft server, we recommend you allocate no more than 50% of the RAM to the Minecraft server – so in our example, no more than 8GB.  

Finished Installation

After selecting the amount of RAM, your Minecraft server has been set up.  

Minecraft Installer Script: Finished Minecraft Forge Installation

Your server has been saved in the displayed directory. To start it go to this directory. In our example use this command:   

cd Servers/Forge-1.20.1

To start the server, use this command:  

./start.sh

Congrats! Your Minecraft Forge 1.20.1 server is up and running in just a few minutes!  

If you want to learn more about the other features of the script and how to use them check out the official documentation of the script. 

Renting a Minecraft Server at GPORTAL

For those who find the prospect of setting up a Minecraft server on a VPS too involved or time-consuming, consider renting through GPORTAL as a user-friendly alternative. This efficient solution prioritizes gaming over server management, providing a hassle-free experience for players with diverse preferences. 

Benefits of Choosing GPORTAL Server Rental

Opting to lease a server from GPORTAL eliminates the need for manual setup and maintenance, making it an ideal choice for those who want to concentrate on gaming rather than dealing with server configurations. GPORTAL’s intuitive platform simplifies server management, catering to both novices and experienced users. 

GPORTAL Rental Process

Renting a server through GPORTAL is a straightforward process. Visit their website, navigate the user-friendly interface to choose your server specifications, including RAM, player slots, and additional features. After configuring, proceed with the rental process, and within minutes, you’ll have a fully operational Minecraft server. 

Advantages of GPORTAL Hosting

GPORTAL hosting offers several benefits, including a user-friendly interface designed for simplicity, dedicated customer support for assistance, and automated updates to ensure your server always operates on the latest version. This managed hosting solution is a viable option for those seeking a streamlined experience, allowing players—casual or dedicated—to immerse themselves in the Minecraft world with minimal effort and maximum enjoyment. 

Scroll to Top