How to run a basic dedicated server under Ubuntu Linux

Post Reply
User avatar
Laser0073
Member
Posts: 59
Joined: Fri Jun 03, 2016 01:26
GitHub: Laser0073
In-game: Laser0073

How to run a basic dedicated server under Ubuntu Linux

by Laser0073 » Post

Ok, so here's a kinda long, but (mostly) complete guide on making a basic dedicated Minetest server on Ubuntu.
I'm making the foolish assumption that you are using Ubuntu 16.04, either the server or desktop version, though this will also work on Debian, I believe.

First, setup openssh-server on your server.

Type this in the terminal:

Code: Select all

sudo apt-get install openssh-server
and press enter.

Next, on the server machine type in this command

Code: Select all

ifconfig
this gives a list of all the network interfaces on the server. The ip will be under the eth0 if you use ethernet.
Mine is 192.168.0.116

On a client machine, type this into a terminal:

Code: Select all

ssh user@ip


for me, this is ssh laser@192.168.0.116.

it will now prompt you for your password on the server for the user laser. Type your password in, and press enter.
Once you are logged in, update the packages

Code: Select all

sudo apt-get update && sudo apt-get upgrade
Next, credit goes to Calinou for this handy script.

Code: Select all

sudo apt-get install -y git build-essential libirrlicht-dev libgettextpo0 libfreetype6-dev cmake libbz2-dev libpng12-dev libjpeg8-dev libxxf86vm-dev libgl1-mesa-dev libsqlite3-dev libogg-dev libvorbis-dev libopenal-dev libcurl4-openssl-dev libluajit-5.1-dev liblua5.1-0-dev libleveldb-dev; cd; git clone https://github.com/minetest/minetest.git; cd minetest/games; git clone https://github.com/minetest/minetest_game.git; cd ..; cmake . -DRUN_IN_PLACE=1 -DENABLE_GETTEXT=1 -DENABLE_FREETYPE=1 -DENABLE_LEVELDB=1; make -j$(nproc); cd ../bin; ./minetest; echo -e "\n\n\e[1;33mYou can run Minetest again by double-clicking \"minetest\" in the \"bin\" folder of the \"minetest\" folder in your home folder.\nYou can install mods in ~/minetest/mods, too.\e[0m"
this will compile minetest on the server. Next, you need to port forward a port for the minetest server. Look up your router to find a guide on port forwarding. For this example, I will forward the port 30000.

Next, on the server type this in: crontab -e

It will show something like this:

Code: Select all

 Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').#
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
#
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h  dom mon dow   command

add the line

@reboot /home/USER/minetest/bin/minetest --server --port 30000 --world WORLD_NAME

It should look something like this:

Code: Select all

 Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').#
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
#
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h  dom mon dow   command
@reboot  /home/laser/minetest/bin/minetest --server --port 30000 --world creative
press ctl+o then enter to save the file.

Now, you're finished! Go ahead, and tweak the worlds/mods however you like, then reboot the server. It should be running on the reboot. Find your public IP using this site: http://www.whatismypublicip.com/

Now to login, set the ip to the public IP address, and the port to the port you assigned for port forwarding. That's all you need to know for the basic setup! Thanks for reading!
i5 6500 OC @3.5GHz, EVGA GTX 960 4GB, 8GB DDR4, ASROCK Pro4S, 128GB.SSD, MT 0.4.17, Linux Mint 18.3 (Ubuntu 16.04)
OwOOOg9CphnceB30eUFX6BOCW8W3jT4i

Post Reply

Who is online

Users browsing this forum: No registered users and 23 guests