Next, add the source list update, add PPA and finally, install Java:
sudo apt-add-repository ppa: webupd8team / java
After adding PPA, please update:
sudo apt-get update
When this update is complete, install Java via the command line:
sudo apt-get install oracle-java8-installer
Now you have successfully installed Java.
Debian
On Debian-based distributions, installing Java is a bit different. You need to scan the free archive. To do this, add non-free to the file /ect/apt/sources.list.
The actual URL you added will change. For example, the old URL is:
deb http://http.us.debian.org/debian stable main contrib
Therefore, the new URL will be:
deb http://http.us.debian.org/debian stable main contrib non-free
When you have added non-free, update the source list:
sudo apt-get update
To install Java, run:
sudo apt-get install sun-java7-jre
Arch Linux
Execute the command:
pacman -S jre7-openjdk
Arch Linux ARMv7
On Arch Linux ARMv7, the best way is to install Java from the Oracle download. Extract this file into / usr / lib / jvm and convert the default Java to:
archlinux-java set jdk1.7.o_60
Gentoo
If you are using Gentoo, just run:
emerge virtual / jre
Other distributions
There is always a download method. Oracle provides download packages for Java that are compatible with most Linux distributions. Available in both 32 and 64-bit packages.
Link download: https://www.java.com/en/download/manual.jsp
Create a folder for your Minecraft server and change the directory to it. Name it ("Minecraft" is a good choice), then navigate to this directory.
mkdir minecraft
cd minecraft
Next, find the latest version of Minecraft server software:
wget -O minecraft_server.jar https://s3.amazonaws.com/Minecraft.Download/versions/1.11/minecraft_server.1.11.jar
If not, download the latest version of the Minecraft server software. Move JAR to your desired Minecraft folder. Switch to that folder, if you haven't done so already.
Finally, run the following command:
java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui
However, the installation will not succeed. First of all, you need to agree with the Eula license. Please enter:
nano eula.txt
This will open the eula.txt file . Just change:
eula = false
city
eula = true
Re-enter the command:
java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui
You can now connect to your newly installed Minecraft server by running Minecraft. Select Multiplayer. Next name the server. Finally, add the address of the machine or the local computer. This will be IP and port. By default, the Minecraft port is 25565. Therefore, the server address will be [IP address]: 25565 . Then just click Done .
Now that you have completed your Minecraft server installation, then learn how to optimize Minecraft for Linux.
For Counter-Strike and other Steam games, you will need a Steam Game Server. However, creating a Steam Game Server is a bit different. The author used a computer with Ubuntu 16.04 LTS. While the Steam Community article suggests creating another user account to use as a Steam server, simply use the default Ubuntu user account.
SteamCMD utility allows you to run a Steam server. This tool downloads and installs dedicated servers for Steam game. To download the SteamCMD installer, paste this into the command line:
cd ~
pwd
mkdir steamcmd
cd ~ / steamcmd
wget http://media.steampowered.com/installer/steamcmd_linux.tar.gz
tar -xvzf steamcmd_linux.tar.gz
Make sure you are in the steamcmd folder . Once you have switched to that folder, run:
./steamcmd.sh
An installer and update script will be executed. Then try logging in. You just need to enter:
login anonymous
You will see a message that you are logged into Steam Public anonymously.
Although SteamCMD is already installed, you still need to add dedicated servers. However, this is a bit complicated. Specifically, if Steam provides a dedicated server and it's completely free, you can still use an anonymous login. But some servers require you to log in with a Steam account.
For example, Team Fortress 2 can play this way. However, if Steam provides a dedicated server and it is not free, you must log in with a Steam account. This is like you are using a Steam client. The Counter-Strike server must be set up this way.
Steam assigns AppID to both client and server.
Counter-Strike Source
Team Fortress 2
But what do you really do with this information? They need to be in specialized directories. Therefore, for Team Fortress 2 server, the default path will be:
/ home / usr / tf2-1
To create the installation directory, run:
mkdir tf2-1
There are two methods to install a game. If you are using anonymous login information, just enter:
cd ~ / steamcmd; ~ / steamcmd / steamcmd.sh + login anonymous + force_install_dir {install-folder} + app_update {appid} validate + quit;
However, if you are required to use Steam ID, please use:
cd ~ / steamcmd; ~ / steamcmd / steamcmd.sh + login {real-steam-id-here} {steam-id's-password-here} + force_install_dir {install-folder-here} + app_update {appid-here} validate + quit;
Therefore, to install Team Fortress 2 server, enter the command line:
cd ~ / steamcmd; ~ / steamcmd / steamcmd.sh + login anonymous + force_install_dir / home / game-server / tf2-1 + app_update 232250 validate + quit;
Some configurations may be required, depending on your setup. To start the game server, navigate to the appropriate directory and execute it. Consider Team Fortress 2 example:
cd /home/game-server/tf2-1/;./srcds_run -secure -game tf -nohltv + port 6005 -steamport 6105 + clientport 6205
Although the previous examples only include Steam games and Minecraft, these are not the only things you want to run the server. That is not the only method to create a game server on Linux.GameServers.com provides a solid solution to this. There is a paid version, but you can try the free version. Check out the free servers at: https://www.gameservers.com/free/
As soon as you request a server, you will receive an email with information about your server. Click the link and follow the instructions (see picture below). Notably, it is especially useful if you have old hardware or simply want a separate server.
Finally, Linux Game Server Managers (reference link: https://linuxgsm.com/) provides a convenient solution. It is a great tool compatible with countless Linux distributions. LGSM boasts more than 50 dedicated servers. In addition, it is open source. Command line tool allows fast deployment of dedicated server games on Linux. Please see the demo below:
Although these are great options, there are many other options for setting up game servers for Linux. If you are using such an option, please let us know in the comment section below!
See more: