Running a Forge server lets you and your friends play Minecraft with mods. Instead of running it on your home computer, a server gives you better performance, 24/7 uptime, and room to grow. This guide walks you through every step to set up and launch your own Forge server. You’ll learn how to install the right tools, configure everything properly, and keep your server secure.
Version Note: This guide uses Minecraft 1.21.10 with Forge 60.0.19. For different Minecraft versions, replace version numbers in commands throughout this guide.
Pre-Setup Checklist
Before you start, gather everything you need. Your server should have at least 6GB of RAM for a comfortable modded Minecraft experience. While some guides suggest 2GB as the minimum, that’s cutting it extremely close and leads to frequent lag with even light modpacks.
For most modded servers with 5-10 players and light-to-medium modpacks (50-100 mods), 6GB RAM handles the load comfortably. This is the sweet spot for getting started without overspending. If you’re planning heavy modpacks with 150+ mods or hosting 15+ players, you’ll want 12-16GB RAM for stable performance. Heavy modpacks with 200+ mods require 16-20GB RAM minimum. Extremely heavy packs like All The Mods or Enigmatica may need 20-24GB for smooth operation.
Your CPU should prioritize single-core performance over core count. Minecraft runs primarily on 1-2 cores, so a processor with 3.5+ GHz clock speed on each core provides smooth gameplay. Having 3-4 cores helps background tasks like world saving and chunk loading, but clock speed matters more than core count. You’ll need about 50GB of NVMe SSD storage minimum. This covers the base installation, mods, world data, and several backups. NVMe storage significantly improves chunk loading and world generation speed compared to traditional hard drives.
Network bandwidth matters for multiplayer servers. Plan for at least 5-10 Mbps upload speed for 5-10 players. More players require proportionally more bandwidth – roughly 1 Mbps upload per player for smooth gameplay. For optimal Minecraft server performance, hosting with NVMe storage and dedicated resources ensures consistent gameplay without the stuttering or lag you’d get from shared environments.
You need SSH access with root or sudo privileges. Make sure your operating system stays up to date. Ubuntu 24.04 LTS (currently 24.04.3) or Debian 12 works great for Minecraft servers. The latest Ubuntu interim release, 25.10, also works, but LTS versions provide longer support. Run system updates before you begin to avoid compatibility issues.
Note: NeoForge is a popular Forge alternative for Minecraft 1.20.5 and newer versions, with NeoForge 21.10+ available for the latest Minecraft releases. This guide applies to both Forge and NeoForge with identical setup steps.
Essential Package Installation
Connect to your server via SSH. If you’re new to managing Linux servers remotely, understanding server management fundamentals will help you navigate server administration more confidently. Update your system packages first.
sudo apt update && sudo apt upgrade
The update process refreshes your package lists and upgrades any outdated software. Expect this to take a few minutes, depending on how many updates are available.
Install the tools you’ll need to run and manage the server.
sudo apt install screen wget openjdk-21-jre-headless
Here’s what each tool does. Screen lets you run the server in the background and detach from it without stopping the process. Wget downloads files directly from the internet to your server. OpenJDK 21 is the Java runtime that Minecraft 1.20.6 and all newer versions require.
After installation completes, verify that Java is installed correctly.
java -version
You should see output showing OpenJDK version 21 or higher. The output will look something like “openjdk version 21.0.x”. If apt fails to install Java 21, download it directly from Adoptium as a backup option.
For Minecraft 1.20.6 and newer (including all 1.21.x versions), Java 21 is required. Using older Java versions causes startup failures with error messages about unsupported class file versions. Always match your Java version to your Minecraft version requirements.
Download and Prepare Forge Server
Create a dedicated directory for your server files to keep everything organized.
mkdir forge_server && cd forge_server
Choosing Your Minecraft Version
While this guide uses Minecraft 1.21.10, you may want to use an older version for better mod compatibility.
Version Recommendations:
- 1.21.10 (Forge 60.0.19): Latest features, fewer mods available
- 1.21.3 (Forge 53.1.0): Good balance, growing mod ecosystem
- 1.21.1 (Forge 52.0.x): Stable, more mods available
- 1.20.1 (Forge 47.x.x): Maximum mod compatibility, most popular for modpacks
Check your desired mods’ compatibility before choosing a version. Most mod developers update to stable releases (x.x.1 or x.x.3) rather than every minor version.
Visit files.minecraftforge.net in your browser to download the Forge installer. This is the only official source for Forge downloads. Never download from file-sharing sites or unofficial mirrors. Select your Minecraft version from the left sidebar. Click on your chosen version.
sudo apt update && sudo apt upgrade
You’ll see two build options. Recommended builds are stable and thoroughly tested – they appear after significant testing. Latest builds have newer features but might contain bugs. For production servers, choose Recommended builds when available. If no Recommended build exists for your Minecraft version (common with very new versions like 1.21.10), Latest is your only option.
Finding Version Numbers: On the Forge downloads page, you’ll see the build number next to each option. For 1.21.10, the Latest build is currently 60.0.19. For older versions like 1.21.3, you may see both Recommended (53.1.0) and Latest (53.1.4+) options available.
Click the Installer button next to your chosen build. Copy the download link from the page. Back in your SSH terminal, download the installer using wget. Replace the URL with the actual link you copied.
wget https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.10-60.0.19/forge-1.21.10-60.0.19-installer.jar
Verify the download completed successfully by checking the file size and integrity.
ls -lh forge-*.jar
You should see the installer jar file listed with its size. The file should be several megabytes (typically 5-10MB). If it’s only a few kilobytes, the download failed and you need to try again.
Run the installer to generate your server files automatically.
java -jar forge-1.21.10-60.0.19-installer.jar --installServer
Replace the version numbers with your actual filename. The installer downloads required libraries and sets up the server structure. Expect this to take a minute or two, depending on your connection speed. You’ll see progress as it downloads Minecraft server files and Forge libraries.
Create and Configure Start Script
A start script makes launching your server easy without typing complex commands every time. Create the script file using any text editor.
nano start.sh
Add this optimized content to the file. These JVM arguments are based on Aikar’s flags, which are the industry standard for Minecraft servers since 2019. They significantly improve garbage collection performance and reduce lag spikes.
#!/bin/bash
screen -S Forge java -Xmx6G -Xms6G -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:MaxTenuringThreshold=1 -jar forge-1.21.10-60.0.19.jar nogui
Let’s explain what each part does. The first line tells Linux this is a bash script. screen -S Forge creates a background session named “Forge” that persists after you disconnect from SSH. Your server keeps running even when you close your terminal. The memory settings are critical for modded servers. -Xmx6G sets the maximum RAM to 6GB. -Xms6G sets starting RAM to 6GB. For modded servers, these values should always match to prevent memory allocation lag during gameplay.
Important: Always leave 2GB of RAM for your operating system and JVM overhead. If you have 8GB total RAM, use -Xmx6G -Xms6G. If you have 16GB total RAM, use -Xmx14G -Xms14G. Never allocate all available memory to Minecraft.
The G1GC flags optimize garbage collection for better performance. -XX:+AlwaysPreTouch preallocates memory for faster startup. The G1 heap region settings optimize memory management for modded servers. These flags work together to minimize lag spikes and maintain smooth gameplay.
These specific values are optimized for 6GB setups. For 12-16GB RAM allocations, adjust the following: use -Xmx14G -Xms14G, change G1HeapRegionSize=8M to 16M, update G1NewSizePercent=30 to 40, and change G1MaxNewSizePercent=40 to 50 for better performance with larger memory pools.
The nogui flag runs the server without a graphical interface, saving resources since you’ll manage everything through the console anyway. Replace the jar filename with your actual Forge version.
Save the file by pressing Ctrl+X, then Y, then Enter. Make the script executable so you can run it.
chmod +x start.sh
Accept Mojang’s End User License Agreement before you can start the server. Create the EULA file and accept it.
echo "eula=true" > eula.txt
Running this command creates the eula.txt file and automatically sets it to true. By doing this, you’re agreeing to Mojang’s terms of service for running a Minecraft server. You can read the full EULA here.
Security Configuration
Your server needs proper security before going online. Start by configuring your firewall with secure defaults that block unauthorized access while allowing player connections.
Set your firewall to deny all incoming connections by default.
sudo ufw default deny incoming
sudo ufw default allow outgoing
The first command blocks all incoming traffic unless you explicitly allow it. The second command allows all outgoing traffic so your server can download updates and communicate with Mojang’s authentication servers.
If UFW isn’t installed, install it first.
sudo apt install ufw
The default Minecraft server port is 25565. Open this port in your firewall to allow player connections.
sudo ufw allow 25565/tcp comment 'Minecraft Forge'
Your firewall now accepts TCP connections on port 25565. The comment helps you remember what this rule is for when you review your firewall later.
Enable the firewall to activate all your rules.
sudo ufw enable
Verify your firewall rules work correctly.
sudo ufw status verbose
You should see port 25565 allowed, default deny incoming, and default allow outgoing. This output confirms your firewall is properly configured for secure server operation.
For better security on private servers, restrict access to specific IP addresses when you know exactly who should connect.
sudo ufw allow from 203.0.113.100 to any port 25565 proto tcp
Replace 203.0.113.100 with the actual IP address of a player. Repeat this command for each player who needs access.
Start and Test the Server
Launch your server for the first time. Run your start script from the forge_server directory.
./start.sh
The server starts in a screen session named “Forge”. You’ll see it loading mods and generating the world. First startup takes 3-10 minutes, depending on your mod count and server performance. Heavy modpacks with 100+ mods can take the full 10 minutes. Light modpacks typically load in 3-5 minutes. Watch for any errors during startup. The console shows detailed messages about each mod loading. Common issues include missing mod dependencies, incorrect Java version, or insufficient RAM. Errors appear in red text with clear descriptions of what went wrong.
Once you see “Done!” followed by how long the startup took, your server accepts connections. This message looks like “Done (123.456s)! For help, type help”.
Monitor server performance by watching the console for tick time warnings. If tick time exceeds 50ms, your server is lagging. For detailed TPS monitoring, install the Spark mod from here and use /spark tps to see real-time performance metrics. A healthy server maintains 20 TPS (ticks per second).
Test that the port is actually listening and bound correctly.
# Modern Linux (ss command)
ss -tuln | grep 25565
# Legacy systems (netstat)
netstat -tuln | grep 25565
You should see a line showing the server listening on 0.0.0.0:25565 or :::25565. This confirms the server is bound to the port successfully and accepts connections. If nothing appears, check your server logs for port binding errors.
From your Minecraft client, make sure you have Forge installed with the same version as your server. Go to Multiplayer and add your server using the IP address. Use your server’s public IP address if you’re connecting remotely.
Try connecting. You should see the server appear online with a green connection bar showing player count. If it works, you’re all set. If it shows offline or connection refused, recheck your firewall settings and verify the server is actually running.
Server Management & Optimization
Managing a screen session is simple once you know the key commands. The screen tool lets you leave the server running while you disconnect from SSH. To detach from the screen session without stopping the server, press Ctrl+A then D. Your server keeps running in the background even after you close your SSH connection.
To reattach and see the console again, use this command from anywhere.
screen -r Forge
“Forge” is the name you gave your screen session in the start script. You’ll immediately see the server console output. If you have multiple screen sessions running, list them all first.
screen -ls
The output shows all active screen sessions with their names and process IDs. You can reattach to any of them using their name or ID.
Stopping your server properly prevents world corruption. Never kill the process or shut down your machine while the server runs. Send the stop command through screen.
screen -S Forge -X stuff "stop$(echo -ne '\015')"
The command sends “stop” to the Forge screen session. The server saves all data and shuts down cleanly. Wait 30-60 seconds before starting it again.
You can send any command without attaching. Here’s how to force a world save.
screen -S Forge -X stuff "save-all$(echo -ne '\015')"
Adding or removing mods is straightforward. Place mod jar files in the mods directory. Remove mods by deleting their jar files. Always restart your server after changes.
cd mods
wget https://cdn.modrinth.com/data/modid/versions/modfile.jar
Download mods only from trusted sources like CurseForge or Modrinth. Verify the mod version matches your Minecraft and Forge versions exactly.
Monitor your server’s resource usage regularly. Install htop for a real-time view.
sudo apt install htop
Run htop to see CPU usage, RAM consumption, and active processes. Press Q to quit. High CPU usage indicates lag. If RAM approaches your limit, upgrade or reduce mods.
The server.properties file contains important performance settings.
nano server.properties
Set the view-distance to 8-10 for most servers. Set simulation-distance to 6-8 to control how far away chunks actively process. Lower simulation distance reduces server load while maintaining playable view distance.
Check your Minecraft server logs for errors. View the current log in real time.
cd logs
tail -f latest.log
The output shows the most recent log entries and updates live. Press Ctrl+C to stop viewing. Look for ERROR or WARN messages that indicate problems.
Backup & Maintenance
Regular backups protect your work. If something breaks or gets corrupted, you can restore it to a working state. Backups should include your world data and important configuration files.
Create a backup directory outside your server folder to keep backups separate from files that could get corrupted.
mkdir ~/backups
Backup your world files and server configuration. This command creates a compressed archive with the current date and time in the filename.
tar -czf ~/backups/world_$(date +%Y%m%d_%H%M).tar.gz -C ~/forge_server world world_nether world_the_end server.properties
The backup includes your overworld, nether, and end dimensions plus your server properties. Mods aren’t included because you can redownload them from their original sources. The backup files stay small and focus on irreplaceable data.
To restore from a backup, stop your server first. Then extract the backup archive to your server directory.
cd ~/forge_server
tar -xzf ~/backups/world_20251112_1430.tar.gz
Replace the filename with your actual backup file. This overwrites your current world files with the backup. Start your server again and your world is restored to that backup point.
Schedule automatic backups using cron to ensure you never forget. Open the cron editor.
crontab -e
Add this line to back up daily at 3 AM. The backup happens automatically without any manual intervention.
0 3 * * * tar -czf ~/backups/world_$(date +\%Y\%m\%d_\%H\%M).tar.gz -C ~/forge_server world world_nether world_the_end server.properties
Old backups consume disk space quickly. Add this cron job to automatically delete backups older than 30 days and prevent your disk from filling up.
0 4 * * * find ~/backups -name "world_*.tar.gz" -mtime +30 -delete
Maintenance tasks keep your server healthy and secure. Update Minecraft, Forge, and your mods regularly. Check for updates monthly or when major versions release. Security patches fix vulnerabilities that could compromise your server or leak player data.
Restart your server periodically to clear memory leaks. Some mods have issues that cause performance to degrade over time as they accumulate entities or cached data. A weekly restart fixes these problems. Set up automatic restarts with cron for hands-off maintenance.
# Stop server at 4 AM Sunday
0 4 * * 0 screen -S Forge -X stuff "stop$(echo -ne '\015')"
# Wait 2 minutes then restart
2 4 * * 0 /bin/bash -c 'cd ~/forge_server && ./start.sh'
These two cron jobs work together. The first stops the server cleanly at 4 AM every Sunday. The second waits two minutes for the shutdown to complete, then starts the server again. Your players see minimal downtime of just a couple of minutes.
Troubleshooting
Even with careful setup, you might encounter issues. Most errors provide clear messages in the console or log files that help you identify and fix problems quickly.
Version Mismatches
Version mismatches cause most connection errors. Your Minecraft client, Forge version, and mod versions must all match exactly. Check each mod’s requirements on its download page.
Out of Memory Errors
Out of memory errors are common with heavy modpacks. Here’s what they look like and how to fix them.
Example error in logs:
java.lang.OutOfMemoryError: Java heap space
at net.minecraft.server.level.ServerLevel.tick
Solution: Increase -Xmx and -Xms values in start.sh from 6G to 14G or higher.
Your server runs out of RAM. Increase the -Xmx and -Xms values in your start script. If you’re already using most of your available RAM, you need to upgrade your server or reduce mods.
Port Binding Failures
Failed to bind to port errors mean something else uses port 25565. Check what’s using the port.
# Modern Linux (ss command)
sudo ss -tulpn | grep 25565
# Legacy systems (netstat)
sudo netstat -tulpn | grep 25565
If another process appears, stop it first or choose a different port. You can change the port in server.properties by editing the server-port setting.
Startup Crashes
Startup crashes usually show clear error messages. Look at the end of your latest.log file.
grep -i "error\|exception" logs/latest.log | tail -20
This filters your log for errors and exceptions. Common causes include missing mod dependencies or incompatible mods. The error messages tell you which mod caused the problem.
Mod dependency errors look like “Missing required dependency X for mod Y”. Get the required dependency from CurseForge or Modrinth, add it to your mods folder, and restart.
Java Version Errors
If your server crashes immediately on startup, check your Java version. Minecraft 1.20.6 and newer require Java 21.
java -version
If the output shows Java 17 or lower, install Java 21 following the Essential Package Installation section.
Debug Logs
The debug.log file contains more detailed information. If latest.log doesn’t help, check debug.log.
tail -100 logs/debug.log
Look for ERROR or WARN messages. Debug logs include technical details about mod loading and internal operations that can help pinpoint complex issues.
Mod Version Incompatibility
Mods designed for older Forge versions may not work with newer versions. Version mismatches appear as clear error messages during startup.
Error example:
This mod requires Forge version 53.1.0 or higher (Current: 60.0.19)
or
This mod is for Minecraft 1.21.3 (Server is running 1.21.10)
Solution: Either downgrade your server to match the mod’s version or find an updated version of the mod compatible with your server version. Check CurseForge or Modrinth for version-specific mod downloads.
Memory Leaks
If your server’s RAM usage gradually increases over time until it crashes, you have a memory leak. Common causes include poorly coded mods that don’t clean up entities, excessive item entities in the world, and redstone contraptions that spawn entities faster than they despawn.
Monitor RAM usage in htop over several hours to check for memory leaks. If usage steadily climbs without stabilizing, restart more frequently or identify the problematic mod using Spark’s profiler. The /spark heapsummary command shows what’s consuming memory.
Conclusion
Your Forge server is ready for players. Monitor performance with htop, backup regularly with automated cron jobs, and update Forge and mods monthly for security patches. Join the Forge Discord at discord.gg/forge for community support and troubleshooting help when you need it.
