> ## Documentation Index
> Fetch the complete documentation index at: https://help.freakhosting.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Install LinuxGSM and Host Game Servers

> LinuxGSM install guide: create a user, download linuxgsm.sh, run ./gameserver install, then start, update, monitor and back up your game server.

To install LinuxGSM, create a user for the game server (for example `vhserver` for Valheim), log in as that user and run `curl -Lo linuxgsm.sh https://linuxgsm.sh && chmod +x linuxgsm.sh && bash linuxgsm.sh vhserver`, then `./vhserver install`. Manage the server with `./vhserver start`, `stop`, `update`, `monitor`, `backup` and `details`.

| Difficulty | Time | Works on | Needs |
| - | - | - | - |
| Intermediate | 20–40 minutes | Ubuntu 24.04, Debian 12 / 13, AlmaLinux / Rocky 9 / 10 | Root or sudo to create the user, enough RAM and disk for the game |

FREAKHOSTING also offers managed game servers on its Game Panel if you'd rather not run them yourself: see [how to log in to the Game Panel](https://help.freakhosting.com/portals/game-panel/how-to-login-and-access-the-game-panel.md).

## Before you start

* **LinuxGSM** (Linux Game Server Managers) is a free command-line tool that installs and manages more than 100 dedicated game servers. Each game has its own script name, such as `vhserver` (Valheim), `rustserver` (Rust) or `ts3server` (TeamSpeak 3). Find yours in the [LinuxGSM server list](https://linuxgsm.com/servers/).
* LinuxGSM recommends Ubuntu 24.04 LTS, Debian 11 or newer, or Enterprise Linux 8 or newer. Use a supported release from that list.
* Run each game server under its own user. LinuxGSM refuses to run as root, apart from the `install` command.
* Check the game's own RAM and disk needs. Many Steam games need several GB of each.

## How to install a game server with LinuxGSM

This example installs a Valheim server. Replace `vhserver` with your game's script name.

**1. Create a user for the game server**

```bash theme={null}
sudo adduser vhserver
```

Set a strong password. On AlmaLinux / Rocky, `adduser` creates the user without asking for a password; set one with `sudo passwd vhserver`.

**2. Switch to the new user**

```bash theme={null}
su - vhserver
```

**3. Download LinuxGSM**

```bash theme={null}
curl -Lo linuxgsm.sh https://linuxgsm.sh && chmod +x linuxgsm.sh && bash linuxgsm.sh vhserver
```

This creates the `./vhserver` script in the user's home folder.

**4. Run the installer**

```bash theme={null}
./vhserver install
```

Follow the prompts. LinuxGSM installs missing system packages itself when the user has sudo rights. If it doesn't, install the packages it reports as missing from a root session, then run `./vhserver install` again. The installer then downloads the server files, often through SteamCMD.

**5. Start the server**

```bash theme={null}
./vhserver start
./vhserver details
```

`details` shows the server name, passwords, ports and the location of the config files.

## How to open the game's ports

Use the ports and protocols that `./vhserver details` lists. For example, if it lists UDP ports 2456 and 2457, exit back to your sudo user and run:

> [tab] Ubuntu / Debian (ufw)
>
> ```bash theme={null}
> sudo ufw allow 2456:2457/udp
> ```

> [tab] AlmaLinux / Rocky (firewalld)
>
> ```bash theme={null}
> sudo firewall-cmd --permanent --add-port=2456-2457/udp
> sudo firewall-cmd --reload
> ```

> [!WARNING]
>
> If you are turning on `ufw` for the first time, run `sudo ufw allow OpenSSH` before `sudo ufw enable`. Otherwise you lock yourself out of SSH. See [set up a firewall with UFW](https://help.freakhosting.com/portals/other/how-to-set-up-a-firewall-with-ufw.md).

## LinuxGSM commands

Run these as the game server user, in its home folder.

| Command | Short | What it does |
| - | - | - |
| `./vhserver start` | `st` | Start the server |
| `./vhserver stop` | `sp` | Stop the server |
| `./vhserver restart` | `r` | Restart the server |
| `./vhserver details` | `dt` | Show ports, passwords and file locations |
| `./vhserver console` | `c` | Show the live console. Press **Ctrl+B**, then **D** to leave without stopping the server |
| `./vhserver monitor` | `m` | Check the server responds and restart it if not |
| `./vhserver update` | `u` | Update the game server, restarting only if an update was found |
| `./vhserver check-update` | `cu` | Check for an update without installing it |
| `./vhserver validate` | `v` | Check and repair the server files |
| `./vhserver backup` | `b` | Save a `.tar.bz2` archive of the whole server |
| `./vhserver update-lgsm` | `ul` | Update LinuxGSM itself |

## How to automate monitoring and updates with cron

As the game server user, run `crontab -e` and add:

```bash theme={null}
*/5 * * * * /home/vhserver/vhserver monitor > /dev/null 2>&1
*/30 * * * * /home/vhserver/vhserver update > /dev/null 2>&1
0 0 * * 0 /home/vhserver/vhserver update-lgsm > /dev/null 2>&1
```

This checks the server every 5 minutes, looks for game updates every 30 minutes and updates LinuxGSM every Sunday at midnight. See [schedule tasks with cron](https://help.freakhosting.com/portals/other/how-to-schedule-tasks-with-cron.md).

## How to change LinuxGSM settings

LinuxGSM's own settings live in `lgsm/config-lgsm/vhserver/` in the user's home folder:

| File | Edit it? |
| - | - |
| `_default.cfg` | No. It is overwritten on updates. Copy settings from it. |
| `common.cfg` | Yes, for settings shared by every instance |
| `vhserver.cfg` (your instance name) | Yes, for this server only. It wins over the other two. |

The game's own config file location is shown by `./vhserver details`.

## How to check it worked

```bash theme={null}
./vhserver details
```

The **Status** line shows `STARTED`, and the ports match what you opened. Players connect to your server IP and the game port listed in `details`, for example `203.0.113.10:2456`.

## Frequently asked questions

### Can I run several game servers on one VPS?

Yes. Create a separate user for each server, or run several instances under one user with different ports. Make sure the VPS has enough RAM for all of them.

### Does LinuxGSM start the server after a reboot?

Not by itself. Add `@reboot /home/vhserver/vhserver start > /dev/null 2>&1` to the game server user's crontab.

### How do I see the console without stopping the server?

Run `./vhserver console`, then press **Ctrl+B** followed by **D** to detach. Pressing Ctrl+C in the console stops the server.

### Where are the backups stored?

`./vhserver details` shows the backup folder. Copy backups off the server too; see [back up a Linux server](https://help.freakhosting.com/portals/other/how-to-back-up-a-linux-server.md).

## Related guides

> [card] [VPS and dedicated server guides](https://help.freakhosting.com/portals/other/vps-and-dedicated-server-guides.md)
>
> Every guide in this section.

> [card] [Minecraft server on a VPS](https://help.freakhosting.com/portals/other/how-to-run-a-minecraft-server-on-a-vps.md)
>
> Java, server.jar and port 25565.

> [card] [Install Pterodactyl Panel](https://help.freakhosting.com/portals/other/how-to-install-pterodactyl-panel-on-a-vps.md)
>
> A web panel for many game servers.

> [card] [Tune Linux for game servers](https://help.freakhosting.com/portals/other/how-to-tune-linux-for-game-servers.md)
>
> Lower latency for players.

> [card] [Set up a TeamSpeak server](https://help.freakhosting.com/portals/other/how-to-set-up-a-teamspeak-server.md)
>
> Voice chat next to your game.

***

> [!NOTE]
>
> **Checked against the official [LinuxGSM documentation](https://docs.linuxgsm.com/)** and the [LinuxGSM Valheim page](https://linuxgsm.com/servers/vhserver/) on 4 November 2026. Commands and ports differ between games; always use what `./gameserver details` shows.

> [!NOTE]
>
> ### Need Extra Help?
>
> If you encounter any issues, our support team is ready to assist:
>
> * **Live Chat:** Quick assistance via our website.
> * **Support Ticket:** [Open a Ticket](https://freakhosting.com/clientarea/submitticket.php)
> * **Discord:** [Join our Community](https://discord.gg/freakhosting)
> * **Email:** [support@freakhosting.com](mailto:support@freakhosting.com)

> [!TIP]
>
> ### Save on Your Hosting
>
> Ready to upgrade your hosting? Use code **KB20** at checkout for **20% off** your first order!

***

**Last Updated:** November 2026


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.