All articles

How to Set Up a Game Server on a VPS

By Harborvm7 min read

How to Set Up a Game Server on a VPS

Key takeaways

  • Most game servers are single-threaded, so fast CPU threads matter more than raw core count.
  • Put the server in the region closest to your players; aim for under 60ms ping for good play.
  • Harborvm takes no backups and no snapshots, so you must copy your own save files off the server.
  • Start small, watch the live resource graphs, and move up a plan only when memory or CPU runs tight.
  • Open only the ports your game needs and keep the OS patched to stay safe.

Running your own game server gives you control over the rules, the mods, and who gets in, and a VPS is the cheapest honest way to do it. This VPS game server setup guide walks through choosing specs, picking a region close to your players, installing the server, locking it down, and scaling as your community grows. You do not need a dedicated machine or a fast home connection. A small Linux VPS with a guaranteed CPU thread and a few gigabytes of memory will host most popular games for a group of friends.

The work splits into five steps. Get the specs right, put the box near your players, install the server software, secure it, and keep your own backups. Each step is short, and the commands are the same whether you host Minecraft, Valheim, or a shooter.

Rows of servers in a data center

Choosing Specs for Popular Game Servers

Pick the plan to fit the game and the number of players, not the other way around. The single most useful fact about game servers is that most of them are single-threaded. The game loop runs on one CPU thread, so a fast thread beats a pile of slow ones. This is why a shared VPS that oversells its cores can stutter even when the dashboard looks idle, and why a guaranteed thread matters. On Harborvm, 1 vCPU is one real CPU thread reserved for you, so the server does not fight neighbours for time.

Memory is the other lever. Here is a rough guide drawn from official sources.

  • Minecraft Java: the Minecraft Wiki lists a minimum of 1GB RAM for 1-4 players, 2GB recommended for 5-10 players, and 4GB for 10 or more. It also notes the server uses at most three cores, with single-core speed mattering most.
  • Valheim: the dedicated server wants a minimum 4-core CPU and 2GB RAM, with 4GB or more recommended for a full session, and clock speed matters more than core count because terrain generation is single-threaded.
  • Counter-Strike 2: official matchmaking runs at 64 tick. A private 128-tick community server roughly doubles the CPU and bandwidth, so plan for the higher number if you want it.

Mapping that onto Harborvm plans: the Small plan (1 vCPU, 2GB, 40GB, $10/month) suits a handful of friends on Minecraft or a light Terraria world. The Medium plan (2 vCPU, 4GB, 80GB, $16/month) covers a busy Minecraft or Valheim server. Heavier survival games like Rust or Palworld are far more demanding and need 8GB or more, which puts you on the Large plan (4 vCPU, 8GB, 160GB) or a custom size up to 16 vCPU and 64GB. Disk is SSD and reserved, so your save files have steady read and write speeds.

Add headroom. If a game wants 4GB, give it the 4GB plan plus room for the OS, not exactly 4GB. A reserved thread performs predictably under load, which is what a game loop needs.

Picking a Low-Latency Region for Your Players

Latency is set by distance, so host the server near the people playing on it, not near you. A player in Europe connecting to a server in Asia will feel every round trip. According to SpeedTestHQ, under 10ms is exceptional, 10-30ms is excellent for competitive play, 30-60ms is good for most multiplayer, and above 100ms players start to notice lag. Stable latency also matters: a steady 35ms feels better than a ping that jumps between 25 and 60.

Harborvm runs servers in America, Europe, and Asia-Pacific. Choose the region that holds most of your group. If your players are split across continents, pick the region that keeps the largest number under 60ms and accept that the far group sees higher ping. There is no setting that beats physics here.

Before you commit a whole community, test it. Deploy a cheap Small VPS in a region, have two or three players run ping against its address, and read the numbers. If they look good, build the real server in that region.

Installing the Server: VPS Game Server Setup Step by Step

The method is the same for most Linux game servers: create a user, install the game files, open a port, and run the server under a service manager so it restarts cleanly. Harborvm gives you Ubuntu, Debian, AlmaLinux, Rocky, or Fedora ready in about a minute, and a browser console if SSH is not set up yet. These steps assume Ubuntu.

  1. Update the system and create a service user. Never run a game server as root.
   sudo apt update && sudo apt upgrade -y
   sudo adduser --system --group gameserver
  1. Install the runtime the game needs. A Minecraft Java server needs a JDK:
   sudo apt install -y openjdk-21-jre-headless

Many Steam-based servers (Valheim, CS2) use SteamCMD instead, which you install from Steam's documentation.

  1. Download the server files into /opt/gameserver owned by the service user, then run the server once to generate its config and accept any licence prompt.

  2. Create a systemd unit so the server starts on boot and restarts on crash. A minimal /etc/systemd/system/minecraft.service:

   [Unit]
   Description=Minecraft server
   After=network.target

   [Service]
   User=gameserver
   WorkingDirectory=/opt/gameserver
   ExecStart=/usr/bin/java -Xmx3G -Xms3G -jar server.jar nogui
   Restart=on-failure

   [Install]
   WantedBy=multi-user.target

Then enable it: sudo systemctl enable --now minecraft.

  1. Forward the port. Harborvm gives each VPS a private address behind the server's IP, with up to 10 forwarded ports. Forward the one port your game listens on: 25565/TCP for Minecraft, 2456-2457/UDP for Valheim. One game usually needs one or two ports, well within the limit, so a dedicated public IPv4 is not required.

If you need a Windows-only server build, you can boot your own Windows Server ISO with your own licence and manage it over Remote Desktop in the browser. For most games the Linux route above is lighter and cheaper, so reach for Windows only when the game ships no Linux server.

Network cables connected to a patch panel

Securing and Backing Up Your Game Data

A game server is an internet-facing service, so treat it like one. Open only the ports the game needs and close everything else. Log in with SSH keys rather than passwords, keep the OS patched, and run the game under its own unprivileged user as shown above. A firewall that permits only the game port plus SSH, together with automatic security updates, covers most of the risk.

Now the honest part about backups. Harborvm takes no backups and no snapshots. You are responsible for keeping your own copies, and for a game server that is your world save, which is the one file you cannot replace. Set up your own routine:

  1. Stop or pause the server briefly, or use the game's save-now command.
  2. Archive the world directory and copy it off the VPS:
   tar czf world-$(date +%F).tar.gz /opt/gameserver/world
   scp world-*.tar.gz you@home:/backups/
  1. Automate it with a cron job that runs nightly, and keep a few days of archives in case corruption slips in unnoticed.

Store the copies somewhere other than the server itself: your own machine, home storage, or an object store elsewhere. The point is that the save survives even if the VPS does not.

Scaling Resources as Your Community Grows

Start on the smallest plan that fits and move up only when the numbers tell you to. Guessing at specs wastes money or starves the server. Harborvm shows live CPU, memory, disk, and network graphs, so watch them during a busy session. The signs you have outgrown a plan are plain: memory sitting near the ceiling, CPU pinned on the server's thread during peaks, or disk filling with save data.

When that happens, move to the next plan up, or ask for a custom size up to 16 vCPU, 64GB, and 500GB. Because CPU threads are dedicated, more players mostly means more memory and a faster thread, not a wider box. If you pay yearly, you get two months free, which is worth it once a server is stable and you plan to keep it running.

Two practical habits keep scaling smooth. First, split heavy workloads: run a busy game and a separate voice or web service on their own VPS rather than cramming both onto one. Second, if your group wants a private, secure way to reach several internal services, Harborvm gives each customer a private network and a built-in WireGuard VPN, so you can connect without exposing extra ports to the world. For that setup, see our guide on setting up a VPN on your VPS.

The next step is small: deploy a Small VPS in the region closest to your players, time the ping with a couple of friends, and install the server. If the game needs more room, the graphs will tell you before your players do, and moving up a plan takes minutes.

Frequently asked questions

How much RAM does a game server need?

It depends on the game and player count. A small Minecraft Java server runs on about 2GB for 5-10 players and 4GB for more. Survival games like Valheim want 4GB or more.

Do I need a dedicated IP for a game server?

No. A private address with forwarded ports works fine for most games. On Harborvm you forward up to 10 ports to your VPS, which covers the single UDP or TCP port most servers use.

Can I run a game server on Windows?

Yes, if the game only ships a Windows server build. You bring your own Windows ISO and licence. For most servers a Linux VPS is lighter and cheaper to run.

What ping is good for online gaming?

Under 30ms feels excellent and 30-60ms is good for most multiplayer. Above 100ms players start to notice lag, so pick a region near them.