Difference between revisions of "Setting up a server"

From Luanti Wiki
Jump to navigation Jump to search
Line 1: Line 1:
 
{{Languages}}
 
{{Languages}}
 
== Setting up a Server ==
 
 
#Start your server on your desired port
 
#*'''Note''': It is recommended to leave the port at the default (30000)
 
#Find out your internal IP of the computer you are running the server on
 
#*'''Linux''': open a terminal and type <code>ifconfig</code> and hit enter
 
#*'''Windows''': Start → Run … → <code>cmd.exe</code> → <code>ipconfig</code>
 
#Check the port forwarding settings on your router
 
#*forward your chosen port for UDP (30000 if you left it default) to the internal IP
 
#*In addition, alter any firewalls you may have to pass the traffic at that port
 
#To see how to '''run''' a server, please read the section below
 
#Let your friends know your external IP
 
#Add <code>server_announce = 1</code> to your minetest.config to announce it to a public server list.
 
#Make sure you make your server [[#Protect-server|safe from damage]].
 
  
 
== Running the Server ==
 
== Running the Server ==
Line 46: Line 31:
 
  minetest.exe --server --worldname ''world_name''
 
  minetest.exe --server --worldname ''world_name''
 
  goto crash
 
  goto crash
 +
 +
== Allowing external players to connect ==
 +
 +
Players outside of your network won't be able to join the server unless you port forward.
 +
 +
#Choose a port to run the server on. The default of 30000 is recommended
 +
#Find out your internal IP of the computer you are running the server on
 +
#*'''Linux''': open a terminal and type <code>ifconfig</code> and hit enter
 +
#*'''Windows''': Start → Run … → <code>cmd.exe</code> → <code>ipconfig</code>
 +
#Login to your router, and port forward UDP on your chosen port to the internal IP you found
 +
#Alter any firewalls you may have to allow traffic to the port you choose
 +
#Make your server listed in the server list by setting the following settings in minetest.conf
  
 
== Protect server ==
 
== Protect server ==

Revision as of 21:14, 10 April 2017

Languages Language: English • Deutsch • français • italiano • 日本語 • русский

Running the Server

Linux

  1. Open a terminal.
  2. Type in YOUR/MINETEST/DIRECTORY/bin/minetestserver or just drop the minetestserver executable (located in /Minetest/bin/) into the terminal (PLEASE READ THE NOTES BELOW!)
    • If you want to specify a specific game ID, the game ID choices are located in /Minetest/games/. Add in --gameid thegameid to the end of the command.
    • If you get the error “Multiple worlds are available.”, the world choices are located in /Minetest/worlds/. Add in --worldname theWorld to the end of the command.
  3. If your server crashes, then look at the debug.txt in /Minetest/bin/
  4. Make sure you make your server safe from damage.

For easy use you can create an file named minetestserver.sh, add the lines below and put it in your /Minetest/bin/ folder. To run the server, just run the file in a terminal.

#!/bin/bash -x

./minetestserver --gameid minetest --worldname world

Windows

  1. Open command prompt by going in the Minetest installation folder, then in the “bin” folder, hold Shift, do a right click on a empty file (not on minetest.exe), click “Open command window here”.
  2. Type this: minetest.exe --server.
    • If you get the error “Multiple worlds are available.”, use minetest.exe --server --worldname world_name instead, where world_name is the name of the world.
  3. If your server crashes, then look at the debug.txt in /Minetest/bin/
  4. Make sure you make your server safe from damage.

If you don't like to start the crashed server, simply start the server out of a batch file which contains the following code:

@echo off
:crash
minetest.exe --server --worldname world_name
goto crash

Allowing external players to connect

Players outside of your network won't be able to join the server unless you port forward.

  1. Choose a port to run the server on. The default of 30000 is recommended
  2. Find out your internal IP of the computer you are running the server on
    • Linux: open a terminal and type ifconfig and hit enter
    • Windows: Start → Run … → cmd.exeipconfig
  3. Login to your router, and port forward UDP on your chosen port to the internal IP you found
  4. Alter any firewalls you may have to allow traffic to the port you choose
  5. Make your server listed in the server list by setting the following settings in minetest.conf

Protect server

The default MTG does not protect from accidental damage (ie: fire) or griefers (malicious player).

  • Install a protection mod, such as areas
  • Disable fire by adding `enable_fire = false` to minetest.conf
  • Disable TNT by adding `enable_tnt = false` to minetest.conf
  • Enable rollback to find out who placed a node, and allow all of a player's nodes to be reverted: `enable_rollback = true` in minetest.conf


See also