Page 1 of 8

[Guide] Create and maintain a server on Windows

Posted: Sat Mar 29, 2014 12:06
by CraigyDavi
I have decided to make my own guide about how to create a Minetest server. This guide will not only tell you how to create a server but also how to maintain the server so that it is actually playable. Yes I do know there are a few guides already, but some of them are outdated and in not enough detail. This guide will be based on running it on windows, if you use Linux it is slightly different.

CREATING A SERVER

Step 1 – What you need to run the server:
  • To run the server there are a few things you will need.
  • A computer which is powerful enough to run the server
  • A router with port forwarding capabilities (most routers have this)
  • Reliable internet connection
  • Recent minetest installation which is functioning properly
  • Single-Player world which is to be used for the server
Also you need to think about: Do I have the time to run the server? Do I have enough technical knowledge? Do I have enough knowledge about minetest? If you answered no to the question/questions then you might want to reconsider your ideas on running a server.

Step 2 – Forwarding the ports:
Forwarding the ports is necessary; it allows people from all corners of the globe to access the server. Most people trip up at this point in creating a server but it is actually very simple. These steps do vary, depending on the brand of router you use.

Firstly, You need to find out your default gateway and access your router settings.
  • Open up command prompt and type ipconfig /all
  • Find where it says Default Gateway
    Image
  • Open up your browser and go to http://yourdefaultgateway (obviously replace mydefaultgateway with your actual default gatway).
  • You will now be at your router settings. This is what mine looks like:
    Image
    Now you need to do the port forwarding.
  • Get to the settings. The port forwarding settings may be in the advanced settings.
  • If you are prompted for passwords try using “admin” or “password”. My password was on the back of the router.
    Image
  • You need to get to the port forwarding settings. They may be under the firewall settings. It may also be called “Forward a new game/application.
  • Make sure you use UDP and port 30000 (thirty thousand) The port used in the port range should translate to the same ports. Click apply.
    Image
  • You also need to make sure that you assign the port range to point to the right device (your computer hosting the server). This may be on a different settings page or it may be on the same settings page.
    Image
The port forwarding is done. Make sure all the settings have been set. It may take a few minutes for the ports to be forwarded and it may require a restart of the computer.

Step 3 – Editing the server settings:
In order to customise the server you need to change the settings. Just copy these settings into your minetest.config file and set them to what you like.

Do you want the server will appear on the public server list at servers.minetest.net.

Code: Select all

server_announce = true
What do you want the name of the server to be?

Code: Select all

server_name = Minetest Server
The address of the server. You can leave this blank unless you are using a sub-domain or a domain.

Code: Select all

server_address =
The port which the server will listen on. This will be the same port you forwarded.

Code: Select all

port = 30000
If you have a webpage or forum thread, you can put the link here.

Code: Select all

server_url = http://minetest.net
A short description of the server.

Code: Select all

server_description = Join this amazing server!
Message of the day. Shown in the chat when someone joins.

Code: Select all

motd = Welcome to this amazing minetest server!
Do you want to disable PvP? By default, PvP is enabled, which means players can hurt and kill each other using melee weapons.

Code: Select all

enable_pvp = false
Do you want people to die or be immortal?

Code: Select all

enable_damage = true
If set to true players will have an infinite amount of items (creative mode).

Code: Select all

creative_mode = false
Maximum amount of users who can join the server at a time. Adjust depending on your bandwidth, CPU and RAM available.

Code: Select all

max_users = 15
Enable rollback functions (can slow down the server):

Code: Select all

enable_rollback_recording = true
Map generation stuff:

Code: Select all

mg_flags = trees, caves, v6_biome_blend, v6_jungles, dungeons
Stop players from connecting with an empty password.

Code: Select all

disallow_empty_password = true
Where new players will spawn and where players will re-spawn after death. If no static spawn point is set, then players will have a slightly randomized spawn location.

Code: Select all

static_spawnpoint = 0, 16, 0
Step 4 – Creating the server launcher:
The server launcher will start the server window and enable people to join the world it will also put the server on the public server list if you have enabled it in the settings.
  • Go to the bin folder in your minetest directory
  • Rightclick on the minetest application and select Create Shortcut
Image
  • Then rightclick on the shortcut and select Properties
Image
  • Put quotes around what there is already in the target box. It should look something like this:

Code: Select all

"C:\Users\YourName\Documents\minetest-0.4.9\bin\minetest.exe"
  • Then add this at the end of the target box (make sure that the name of the world does not contain spaces or symbols):

Code: Select all

--server --worldname TheWorldName
  • It should now look like this:

Code: Select all

"C:\Users\YourName\Documents\minetest-0.4.9\bin\minetest.exe" --server --worldname TheWorldName
  • Click apply and ok.
Step 5 – Starting the server and joining it:
This step tells you how to start the server and then how to join the server afterwards.
Starting the server
  • To start the server all you need to do is click the server launcher you created in the last step. If you have installed minetest in the program files (or any other protected folder) you need to rightclick on the laucher and select Run as Administrator. It should open a window which looks something like this:
    Image
    Joining the server
  • If you have the server window open you should be able to join it easily. Open up the game.
  • You should be able to connect using your external IP. You can find out your external IP by going to http://www.whatsmyip.us. Connect using the port you port forwarded (30000).
    Image
  • If that does not work then you can try connecting using 127.0.0.1. This will tell minetest to connect to a server on your computer. Connect using the port you port forwarded (30000).
    Image
  • You should be able to join the game and so should other people. Enjoy your minetest server!
Image

MAINTAINING A SERVER

Here are a few tips in order to keep your server in a good state. If you have any more tips then suggest them and I can put them here.

Protect areas:
It is always good to install a protection mod, this means people can protect areas they do not want others to ruin. One of the best mods which you can use for this is ShadowNinja’s areas mod. It prevents grefing and stops people from destroying buildings on the server, if you protect the area beforehand.

Remove interact as a default privilege:
Interact privilege lets players dig and place blocks. By default players get it as soon as they join. It is a good idea to disallow players from being able to dig and place blocks as soon as they join or else they can easily destroy blocks without asking a moderator for the privilege.
Make sure this is in minetest.config. They get no interact priv when they join, just shout.
default_privs = shout
You can grant individual players interact using /grant playername interact.

Keeping a server up 24/7:
Minetest servers crash quite frequently so if you want to keep it up 24/7 you will need so way of restarting the minetest server when it crashes. A good application for windows is http://w-shadow.com/blog/2009/03/04/restart-on-crash Also if you are running a 24/7 server it would be best if you turned off every visual style thing like Aero and screen-savers.

Antivirus Scans:
If you are using antivirus on your computer make sure you exclude the world folder used by the server. Sometimes antivirus scans can corrupt sqlite3 maps.

RUNNING A SERVER – FREQUENTLY ASKED QUESTIONS

Spoiler
Give us more information. Which step did you fail at? Did you get any errors?
Spoiler
Check that you used the correct worldname and filled in the properties correctly. Check that the worldname does not contain spaces or symbols.
That’s it! I hope you found this guide useful. If I have made any mistakes please tell me.

Information up to date with version 0.4.9

Posted: Sat Mar 29, 2014 13:11
by Krock
Thanks for this guide! This will help alot windows users.

A little addition:
If the Minetest folder is contain in the Program Files (or any other protected folder), then right click on the shortcut and select "Run as Administrator".

System scans by the antivirus can currupt sqlite3 maps, therefore add a scanning-exception for the location, where the world is stored.

If you decide to use the computer as 24/7 server, then make sure, you turned off every visual style thing like Aero and screensavers. Please look at the Watt-consuming of the computer!

Posted: Sat Mar 29, 2014 14:11
by CraigyDavi
Krock wrote:Thanks for this guide! This will help alot windows users.

A little addition:
If the Minetest folder is contain in the Program Files (or any other protected folder), then right click on the shortcut and select "Run as Administrator".

System scans by the antivirus can currupt sqlite3 maps, therefore add a scanning-exception for the location, where the world is stored.

If you decide to use the computer as 24/7 server, then make sure, you turned off every visual style thing like Aero and screensavers. Please look at the Watt-consuming of the computer!
Thanks, I have added your extra information.

Posted: Mon Mar 31, 2014 11:18
by Bob Hovercraft
Hi Craig,

Great guide, thanks for sharing - I'm staying on your server though! No plans to start up my own so I hope I never need the guide :o)

Posted: Mon Mar 31, 2014 14:01
by CraigyDavi
Bob Hovercraft wrote:I'm staying on your server though!
Good to hear :D

Posted: Mon Mar 31, 2014 14:58
by kaeza
Krock wrote:If the Minetest folder is contain in the Program Files (or any other protected folder), then right click on the shortcut and select "Run as Administrator".
You should never use that option when running Internet-facing applications (like Minetest), or in general, don't use that option unless STRICTLY required (for any program).

I recommend moving Minetest out of "Program Files" into "My Documents" or "Desktop" and running from there.

Posted: Tue Apr 01, 2014 01:07
by ZachyGames
My Question: I cant load mydefaultgateway site it says google chrome cant find mydefaultgateway PLEASE HELP!

Posted: Tue Apr 01, 2014 02:44
by Enke
First off, CraigyDavi, Excellent Guide for those of us on Windows. Nice Screenies, good formatting, excellent excellent excellent. This thread should be stickied next to Menche's thread.

ZachyGames wrote:My Question: I cant load mydefaultgateway site it says google chrome cant find mydefaultgateway PLEASE HELP!
mydefaultgateway is not a website, CraigyDavi was using it as an example.

Assuming you are on windows:
1: Open the command line
2: type: "ipconfig" in the command line (no quotes)
3: search the output until you find a line that says "default gateway"
4: Look at the numbers on that line, something like: "192.168.1.1". Note the numbers that you have, I'll refer to it as the "ip"
5: Go into Google Chrome. In the search box type: "http://<ip>", where "ip" is the numbers on the "default gateway" line

Posted: Tue Apr 01, 2014 06:48
by CraigyDavi
Enke wrote:First off, CraigyDavi, Excellent Guide for those of us on Windows. Nice Screenies, good formatting, excellent excellent excellent. This thread should be stickied next to Menche's thread.
Thank you! And thanks to whoever stickied it :)
ZachyGames wrote:My Question: I cant load mydefaultgateway site it says google chrome cant find mydefaultgateway PLEASE HELP!
You replace mydefaultgateway with your actual default gateway which you find out in the previous step.

Posted: Tue Apr 01, 2014 09:11
by PilzAdam
.eltit eht ot ']swodniW[' dda dluohs uoY

Posted: Tue Apr 01, 2014 12:57
by twoelk
PilzAdam wrote:.eltit eht ot ']swodniW[' dda dluohs uoY

Indeed I wonder how many minetest servers on windows are out there.

Actually some information on how many Mintest servers are on wich OS might be interesting and might give clues to platform related performance issues.

Posted: Tue Apr 01, 2014 14:02
by CraigyDavi
PilzAdam wrote:.eltit eht ot ']swodniW[' dda dluohs uoY
Done

Posted: Fri Apr 04, 2014 08:29
by ZachyGames
Can "You" Help me here

Image


BTW WHO NOTICED A ORE IN THE PICTURE IN THE JOINING THE SERVER (Not Coal)

Posted: Fri Apr 04, 2014 09:09
by hoodedice
You're nearly done there.

Click the Start button. Type 'Run' without quotes in the search box and open Run. Type 'ncpa.cpl' without quotes, and press Enter. Right click your current, working internet connection and click Status. I'm on Windows 8.1, so you would need to look around for the 'IPv4 Address', or something that looks like 192.168.x.xxx . This should be different from what you typed in the browser to open that page you're currently on.

OR

Do the first step in this tutorial. Check the ipv4 address as given out by the command prompt.


Just copy-paste the IPv4 address into the IP Address field in that page you took a screenshot of. The protocol is UDP, and the port is 30000

Posted: Fri Apr 04, 2014 09:45
by ZachyGames
How to open minetest.config it says windows dont know what program to open it

Posted: Fri Apr 04, 2014 11:15
by Krock
ZachyGames wrote:How to open minetest.config it says windows dont know what program to open it
notepad.exe

Posted: Fri Apr 04, 2014 11:16
by kaeza
ZachyGames wrote:How to open minetest.config it says windows dont know what program to open it
Open it in Notepad manually.

Alternatively, select "Choose program from a list" (or something like that) when prompted, check "Always use this program to open this kind of file", then click OK. From now on, all .conf files will be opened in Notepad.

Posted: Fri Apr 04, 2014 14:08
by CraigyDavi
ZachyGames wrote:How to open minetest.config it says windows dont know what program to open it
I would recommend using wordpad instead of notepad. It's preinstalled on windows.

Posted: Sat Apr 05, 2014 04:41
by ZachyGames
CraigyDavi wrote:
ZachyGames wrote:How to open minetest.config it says windows dont know what program to open it
I would recommend using wordpad instead of notepad. It's preinstalled on windows.
Thank you your the best

Posted: Sat Apr 05, 2014 05:06
by ZachyGames
help again!?

Image

Posted: Sat Apr 05, 2014 07:34
by Krock
ZachyGames wrote:help again!?

http://imgur.com/5ha8VzN.jpg
Dude, I see the location of your minetest.exe already in the picture, look at the field above "Shotcut Key:".

Re: Guide: How to create and maintain a server - Windows

Posted: Wed Jun 04, 2014 18:23
by TG-MyinaWD
Do everyone have 192. as there Default Gateway?
But can someone play with me having my default port?
Since I think my Default is 49301 or 53081.
Since really all I like do is play with a Family Member. so should I just use my Gateway and Whatever My Port should be for them join?

Re: Guide: How to create and maintain a server - Windows

Posted: Thu Jun 05, 2014 14:59
by Krock
Alt. Tester wrote:Do everyone have 192. as there Default Gateway?
But can someone play with me having my default port?
Since I think my Default is 49301 or 53081.
Since really all I like do is play with a Family Member. so should I just use my Gateway and Whatever My Port should be for them join?
192.168.*.* is a common router network address, which is only accessable fromt he people which are in the same network.

If your family member is in the same network, means: using same router, then you only need to use the "Server" tab in the main menu. Start a world and it'll be playable at the given port within your network.
For this case: No portforward needed.

Re: Guide: How to create and maintain a server - Windows

Posted: Thu Jul 10, 2014 17:56
by TheCrafter
Hi I have this very little problemo. The thing is that my connection always time's out. Why?

Re: Guide: How to create and maintain a server - Windows

Posted: Thu Jul 10, 2014 19:14
by Krock
TheCrafter wrote:Hi I have this very little problemo. The thing is that my connection always time's out. Why?
Are there any special mods enabled?
Could you post the last 20 lines of debug.txt of your server and client?