Difference between revisions of "Setting up a server"

From Luanti Wiki
Jump to navigation Jump to search
m
(Page is moving!)
Tag: Replaced
 
(37 intermediate revisions by 10 users not shown)
Line 1: Line 1:
{{Languages}}
+
[https://dev.luanti.org/Setting_up_a_server/ This page has been moved to the new Luanti Developer Wiki!]
 
 
== Running the Server ==
 
 
 
=== Graphical Client ===
 
 
 
If you want to host a server to play on with friends, then the simplest way
 
to start it is to use the Minetest client. Note that you are hosting the server
 
on your computer, and the server will shutdown if you leave the game.
 
 
 
* Go to the server tab
 
* Make sure a world is selected
 
* Enter your username and password
 
* Click start
 
 
 
=== Linux ===
 
 
 
#Open a terminal.
 
#Type in <code>YOUR/MINETEST/DIRECTORY/bin/minetestserver</code> or just drop the minetestserver executable (located in <code>/Minetest/bin/</code>) into the terminal '''(PLEASE READ THE NOTES BELOW!)'''
 
#*If you want to specify a specific game ID, the game ID choices are located in <code>/Minetest/games/</code>. Add in <code>--gameid '''thegameid'''</code> to the end of the command.
 
#*If you get the error “Multiple worlds are available.”, the world choices are located in <code>/Minetest/worlds/</code>. Add in <code>--worldname '''theWorld'''</code> to the end of the command.
 
#If your server crashes, then look at the <code>debug.txt</code> in <code>/Minetest/bin/</code>
 
#Make sure you make your server [[#Protect-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 ===
 
 
 
#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”.
 
#Type this: <code>minetest.exe --server</code>.
 
#*If you get the error “Multiple worlds are available.”, use <code>minetest.exe --server --worldname '''world_name'''</code> instead, where <code>'''world_name'''</code> is the name of the world.
 
#If your server crashes, then look at the <code>debug.txt</code> in <code>/Minetest/bin/</code>
 
#Make sure you make your server [[#Protect-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.
 
 
 
#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. Look for "inet adr" near "wlan0" or "eth0".
 
#*'''Windows'''
 
#** Open command prompt: Start → Run …, enter <code>cmd.exe</code> and hit enter.
 
#** Type <code>ipconfig</code> and hit enter.
 
#** Look for <code>IPv4 Address</code>.
 
#*'''macOS''': Open the command prompt and enter netstat -nr.
 
#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
 
#* <code>server_announce = true</code> - makes Minetest tell the server list about the server.
 
#* <code>server_name</code> - set the value of this to your server's name.
 
#* <code>server_description</code> - set the value of this to a longer description describing your server.
 
#* <code>server_address</code> - if you have a domain name for your server, then set this to the domain name.
 
#* <code>server_url</code> - if you have a website for your server, then set this to the website URL.
 
#* <code>motd</code> - a message that is sent to the player when they join. Use this to welcome them.
 
#* You should restart the server to make sure any changed settings changed
 
 
 
== Protect server ==
 
 
 
The default MTG does not protect from accidental damage (ie: fire) or griefers (malicious players).
 
 
 
* Install a protection mod, such as [https://forum.minetest.net/viewtopic.php?t=7239 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 ==
 
* [[Help:Setting up a server/Debian|Setting up a server/Debian]] page for more Debian (Ubuntu) related information.
 
* For more possible commands study the [[Command line]] page.
 
* This forum thread "[https://forum.minetest.net/viewtopic.php?f=10&t=2870 Illustrated Server Creation Guide]" may be of general interest.
 
* See this forum thread for more information about "[https://forum.minetest.net/viewtopic.php?f=10&t=8924 How to create and maintain a server - Windows]"
 
* See this forum thread for "[https://forum.minetest.net/viewtopic.php?f=10&t=1825 Server performance settings]"
 
 
 
[[Category:Tutorials]]
 
[[Category:Server]]
 

Latest revision as of 22:44, 14 December 2024