Server - oldnapalm/GTACoop GitHub Wiki

Setup a server

This page will guide you to setting up and running a GTA Coop server.

Windows

Requirements

  • Windows 10 (1607 and above) or Windows Server 2022 (older versions of Windows might work but are not supported).

Instructions

  • Download the latest server files for Windows and extract them.
  • Open gtaserver.core.exe and wait for the server completely start.
  • Gracefully shut down the server by pressing CTRL + C.
  • Browse to the newly created Configuration folder and edit serverSettings.xml.
  • Edit the configuration, and start the server again after saving the file.

Linux

NOTE: These instructions have been tested on Ubuntu on WSL (Windows Subsystem for Linux), the instructions might differ on other Linux distributions.

Requirements

  • libunwind8 (apt-get install libunwind8)
  • wget, unzip

Instructions

  • Copy the url of the latest server files for Linux.
  • Download the ZIP file wget <the link you copied>, and extract them unzip server-*.zip.
  • Allow the executable execute privileges chmod +x gtaserver.core.
  • Run the server ./gtaserver.core.
  • Gracefully shut down the server by pressing CTRL + C.
  • Browse to the newly created Configuration folder and edit serverSettings.xml.
  • Edit the configuration, and start the server again after saving the file.

Connecting

After your server is ready you will be able to connect, however for others to connect you often need to do a bit more.

Add Windows Firewall rule

Run in Command Prompt (as administrator)

netsh advfirewall firewall add rule name="gtaserver.core" dir=in action=allow protocol=UDP localport=4499

LAN

In situations that all players are connected to the same network, everyone will be able to reach your server. To find the IP address of your server use the ipconfig command in CMD or the ifconfig command on Linux and look for your IPv4 address.

Port forwarding

NOTE: The server is able to sometimes port forward automatically, you can check by looking for the message Server available on 198.51.100.0 in the server console.

When you want everyone on the internet to connect to your server you will have to forward the port in your router. Port forwarding will be different per router, but often come down to these steps.

Start by finding the IP address of your server, you can do this by following the instructions under 'LAN'.

  • Login to your router web interface ('Default Gateway' in ipconfig output).
  • Browse to the 'Port Forwarding' page.
  • Add a new entry, enter your server (computer) IP address, server port. And select UDP as protocol.

Port forwarding details for various routers can be found here.

Hamachi

When you are unable to port forward it is also possible to use a VPN provider such as Hamachi to open your server for others.

  • Create a network with the name and password of your choice.
  • Have everyone join the Hamachi network.
  • Have your players copy your IPv4 address in Hamachi, they can do so by right-clicking on you and selecting 'Copy IPv4 address'.

Plugins

The server provides support for plugins for extending the server functionality. For example adding commands or gamemodes to your server.

Installing plugins

  • Extract all plugin files to the Plugins folder.
  • Add the plugin to your serverSettings.xml to enable it.
<ServerPlugins>
    <string>DiscordBot</string>
</ServerPlugins>

Installing gamemodes

  • Extract all gamemode files to the Gamemodes folder (create it if it does not exist).
  • Set the gamemode in the serverSettings.xml file.
<GamemodeName>Race</GamemodeName>

Writing plugins

To write plugins or gamemodes please see the guide here.

Common issues

There are some issues you might run into, you can referrer to this page for solutions to some common problems.

System.InvalidOperationException: There is an error in XML document

This error means you made a mistake while editing the server configuration, you can delete the serverSettings.xml to restore the original configuration.

Network WarningMessage: UPnP port forward failed

You will see this warning during the server start, if you get this warning it means the automatic port forwarding failed. This is a non-fatal warning and can be safely ignored. You can also disable it by setting UPnP to false in the server configuration.

Failed to establish connection - no response from remote host

You are unable to connect to your server, this could have many reasons but make sure you have gone over the connecting guide.

Failed to load the dll from ... coreclr.dll

Please make sure you have the latest version of Windows, only Windows 10 (1607 and above) or Windows Server 2022 are supported.

error: libunwind.so.8: cannot open shared object file

This error happens on Linux when you do not have libunwind8 installed, please install it by running apt-get install libunwind.

⚠️ **GitHub.com Fallback** ⚠️