Are you an avid Minecraft player looking to create your server on the reliable and scalable platform of Google Cloud? Setting up your own Minecraft server can be an exciting endeavor, allowing you to customize your gameplay, play with friends, and enjoy uninterrupted gaming sessions. In this step-by-step guide, we will walk you through the process of creating a Minecraft server on Google Cloud, from start to finish.
Table of Contents
In this guide, we’ll walk you through the process of setting up a Minecraft server on Google Cloud. With Google Cloud’s robust infrastructure, you can ensure a seamless and lag-free gaming experience for you and your friends.
Before you begin, make sure you have:
- A Google Cloud account.
- Basic familiarity with Minecraft and server management.
2. Creating a Google Cloud Account
If you don’t have a Google Cloud account, visit the Google Cloud Console and create an account. You might need to provide billing information, but Google often offers free credit to get you started.
3. Setting Up a Virtual Machine Instance
- Log in to your Google Cloud Console.
- Navigate to the “Compute Engine” section.
- Click “Create Instance” to set up a virtual machine.
- Choose the machine configuration and specifications that suit your needs. (use Ubuntu server for easy management)
4. Installing Java
Java is essential for running the Minecraft server. Connect to your virtual machine through SSH by clicking the highlighted button
Once connected, install Java using the package manager using the command on SSH Window:
sudo apt update
sudo apt install openjdk-17-jre-headless
5. Downloading and Configuring Minecraft Server Files
- Create a directory for your server files:
Download the Minecraft server files from the official websites
For Paper and other users rename your jar file (here we are renaming paper-1.20.1-164.jar to server.jar)
mv paper-1.20.1-164.jar server.jar
Create start.sh file for the server starting
Now a blank window will open like this
Now paste the code to this window
sudo java -Xms1G -Xmx2G -jar server.jar nogui
Here you can see the -Xms1G and -Xmx2G , -Xms1G signifies that the server minimum RAM usage is 1GB its denoted by the ending 1G and -Xmx2G signifies that the maximum RAM usage which is 2GB denoted by the ending of 2G
Use that code according to your server requirements
Now Save the file using Ctrl + X then Press Y to save the file, and the window will confirm the file name, press enter to confirm
Now give permission to the start.sh file by using this command
sudo chmod 777 start.sh
Now initiate the primary server starting by using the command
It will start the server and close with an error, Now its time to edit eula.txt, for that enter the below command
It will open a window and edit the code into this (change false into true)
#By changing the setting below to TRUE you are indicating your agreement to our EULA (https://aka.ms/Minecraft>
#Thu Aug 24 04:23:51 UTC 2023
Now we need to install the screen on our server
apt install screen
Press Y if asked for any confirmation
Now open a new screen by typing
On the console press Space Bar for further move
The Screen is the service that allows the service to run background
Now you can see a fresh console in that console you can start the server and close the ssh window
6. Adjusting Server Settings
Modify the server properties file using a text editor of your choice:
Customize settings such as game mode, difficulty, and server name.
7. Opening Firewall Ports
Open the necessary ports in the firewall to allow players to connect to your server
For that, you need to open the Firewall Rules in Google Console
Now add rules on the window
Click highlighted button and open the below window
Add Name in the Name* column
Scroll down and you will see this settings
Setup the server target here , I used All instances in the network
Now Scroll down and add Ports here
Tick mark TCP and UDP and add your server Port , The Default port is 25565
If you are making a crossplay server make sure you add 19132 too
Now Click Create button
Now all server setup is finished , now open the SSH tab again and enter screen then enter the command to start server
8. Connecting to Your Server
In Minecraft, add your server’s IP address to the server list and connect to it.
IP is available in the VM Instances tab under the column of External IP
9. Enabling Mods and Plugins
To enhance your gameplay, you can install mods and plugins. Ensure compatibility and follow installation instructions.
10. Backing Up Your Server
Regularly back up your server data to prevent loss in case of technical issues.
11. Managing and Scaling Your Server
Learn how to manage player permissions, handle server moderation, and consider scaling up as your player base grows.
12. Optimizing Performance
Implement performance optimization techniques to ensure smooth gameplay and reduce lag.
Congratulations! You’ve successfully set up your Minecraft server on Google Cloud. Enjoy playing with friends and exploring endless possibilities.