Entertainment Linux

Everything You Need to Build a Game Server on Linux

Christian Cawley Updated 16-03-2020

Gaming has always been more fun with multiple players. It started back with the Atari 2600 and arcade cabinets. When the internet age arrived, game servers made remote multiplayer action a reality.

Advertisement

With the current generation of PC gaming, you can connect to servers or run one yourself. Minecraft, Counter-Strike, and many other games support multiplayer on public and private servers.

The best results are with Linux servers. Whether the game is on Windows, macOS, or even on Android, a Linux game server is ideal.

Here’s what you need to know to build a game server on Linux.

Requirements for Building a Game Server

There’s a misconception that building a game server requires beefy hardware. On the contrary, the you don’t need high-end hardware. However, low spec computers likely won’t yield optimum performance.

It really depends on what games you plan to host on your Linux game server. So, how can you get started?

Advertisement

Well, you need to know a few things first. While building a game server on Linux is not terribly difficult, it does mandate some networking and computer familiarity. What you don’t know, look up online.

Then there’s the hardware. You basically have three choices, all with limitations:

  • A compact and affordable SBC (single board computer) like the Raspberry Pi
  • Your PC, with some enhanced system specs
  • A dedicated Linux game server, hosted elsewhere

Let’s look at the pros and cons of each.

Hosting a Linux Game Server on Raspberry Pi

Hosting a game server on a Raspberry Pi is straightforward, but you will be limited to mostly older games. However, the computer is affordable, low power, and has built-in wireless networking and Ethernet.

Advertisement

This makes it ideal for hosting multiplayer gaming environments such as Minecraft, QuakeWorld, Terraria, Windward, and even OpenTTD and FreeCiv.

Interested in using a Raspberry Pi-powered Linux game server? For more details, check our list of Raspberry Pi game servers 10 Game Servers You Can Run on a Raspberry Pi The Raspberry Pi can do many wonderful things, including run as a game server. Here are some of the best games it can host. Read More . Note that most of the games on the list can also be hosted on a standard Linux PC.

Use Your PC as a Game Server

Planning to use your PC to host multiplayer network games? Using your PC as a game server running on Linux is a smart option if you have a powerful rig. It will be able to cope with anything from Minecraft to Call of Duty: Black Ops.

This comes with some shortcomings, however. You’ll need to leave the PC switched on and connected to your network full time. A dedicated IP address is also recommended, adding to the potential outlay.

Advertisement

There is also the challenge of keeping your server up to date, patching the Linux OS, keeping it secure, and upgrading the hardware when necessary.

Lease a Dedicated Linux Game Server

You can also lease a server that can be set up with game server software.

Saving a lot of time, this is a solution for hardcore multiplayer gamers. While dedicated Linux game servers are affordable (from around $10 a month for a basic Minecraft server) it does represent a regular outgoing that you might not want to commit to.

On the other hand, leasing a server saves time with maintenance, and avoids the cost of a dedicated IP address. You will, however, be limited to hosting games supported by your chosen Linux game server software.

Advertisement

Host your Linux games with a leased GameServers server

GameServers.com offers a solid solution, with good quality servers provided for network play. They also have free servers available for popular older games.

Building a Game Server With Linux

Once you’ve settled on a solution that suits your games, gamer group, and budget, it’s time to build the server. For a leased solution you can click a few buttons on a website; if you’re using your PC, you need to check a few things:

  • Is a server available?
  • Is online multiplayer supported?
  • Does your PC meet the hardware requirements?

You should also consider whether a dedicated IP address is required from your ISP. This will allow players from around the word to access your server. However, a dedicated IP address is not cheap. Sticking to local network play will prove considerably more affordable.

Do you need a game server manager?

Which Linux Distro Is Best for a Game Server?

However you proceed with your Linux game server, you need to choose the best distro for the game.

For anyone new to this, the most accessible Linux version, Ubuntu, makes an excellent game server. With so much documentation, advice, and blogs on this operating system, not to mention a wide selection of supported hardware, it should be straightforward to set up to host games.

Alternatives you might consider include:

  • Debian
  • Arch Linux
  • Gentoo

In short, you’re looking for a distro that is easy to use, suits your hardware, and can support the game.

What Game Servers Can You Build With Linux?

So many popular games come with online multiplayer support. So, when installed on systems on the same network as your game server, the games detect any multiplayer sessions.

Example games include:

  • Minecraft
  • Team Fortress 2 (above)
  • Counter-Strike

However, the options are far wider than this trio. You might create a game server for any of these titles with relative ease. For other games, check if they support network multiplayer.

You don’t even need a full-sized PC in some cases. The Raspberry Pi is a prime candidate for Minecraft, for example. Check our detailed guide on how to set up Minecraft server on Raspberry Pi How to Set Up a Minecraft Server on Raspberry Pi Want to host your own Minecraft server? The Raspberry Pi is ideal. Here's how to set up a Minecraft server on a Raspberry Pi. Read More for details. For desktop, see our guide to setting up a Minecraft server How To Setup a Minecraft Server Minecraft has exploded over the last couple of years to become one of the greatest indie games of all time. There’s simply so much you can do with the game - not only by its... Read More .

Creating a Steam Game Server

For Counter-Strike and other Steam games, you’ll need a Steam game server. However, creating a Steam game server is a bit different. For the widest support for as many games as possible on Linux, it is best to use Ubuntu with Steam.

Steam’s up-to-date list of dedicated game servers for Linux will help you decide. Some servers require the original game to be purchased (such as the Counter-Strike Global Offensive Dedicated Server). Others (e.g. Terraria) don’t require the original.

What does this mean? Well, you could host a game server for a game you don’t own on Linux but have on Windows.

Steam Game Server isn’t available by default with Steam. After installing the game client, you’ll need SteamCMD to manage your games. Start by creating a Steam user in your Linux terminal:

useradd -m steam

create and enter the user’s home folder:

cd /home/steam

To install on a 64-bit system, add the multiverse repository and update:

sudo add-apt-repository multiverse

sudo dpkg --add-architecture i386

sudo apt update

Finally, install steamcmd:

sudo apt install lib32gcc1 steamcmd

If you’re running a 32-bit system, you don’t need the multiverse repository. Instead, after creating the home folder, use

sudo apt install steamcmd

Check the Steam support pages for instructions for other Linux distros.

With SteamCMD installed, run it with:

cd ~

steamcmd

As noted, SteamCMD supports anonymous login for most game servers. Use

login anonymous

For dedicated servers you’re planning to host beyond your home network, it is wise to create a new Steam account. This should have different credentials to your usual Steam game client.

Setting Up a Steam Game Server

To install a game server on Steam, enter the name of the installation directory:

force_install_dir <path>

(where <path> leads to a directory named to match the game).

Steam assigns AppIDs for both clients and servers. For example:

Counter-Strike Source

  • Client AppID: 240
  • Server AppID: 232330

Team Fortress 2

  • Client AppID: 440
  • Server AppID: 232250

To install (and update) a Steam game server:

app_update <app_id>

For Counter-Strike Source, use

app_update 232330

To connect to your Steam game server, simply run the game on your client PC. If the game server isn’t automatically detected, select the multiplayer or network play option. The game server should be listed here, so login and play.

Multiplayer With Linux Game Server Managers

Finally, Linux Game Server Managers provides a nifty solution. It’s a fantastic tool that’s compatible with most. LGSM boasts more than 50 servers. Plus, it’s open source and integrates with SteamCMD. The command line tool allows quick deployment of game servers on Linux.

Find out more by visiting linuxgsm.com.

Time to Build Your Linux Game Server

Building a game server for Linux isn’t easy, but there is enough good software to stop it becoming complex.

Whether you’re setting up a Minecraft server or preparing for some frag action on Counter-Strike Source, the tools are available. If your hardware is up to the task, your game server should be a fun, popular destination for fellow gamers.

As you’ll probably want to chat with your opponents, here’s how to set up your own Discord server How to Set Up Your Own Discord Server Setting up your own Discord server is easy! Here's a step-by-step walkthrough of the entire process. Read More .

Related topics: DIY Project Tutorials, Home Server, Linux.

Affiliate Disclosure: By buying the products we recommend, you help keep the site alive. Read more.

Whatsapp Pinterest

Leave a Reply

Your email address will not be published. Required fields are marked *

  1. ZentixZaneic
    December 28, 2016 at 4:15 pm

    This works on Bash on Ubuntu on Windows. I tried it, and it worked just like it would on Ubuntu. So if you wanted to let your friends connect, you would still have to port forward, correct?

    • Anthony ojei
      August 29, 2017 at 3:25 pm

      i want to develop game like monopoly game,can can i use only java,pls help