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

# How to set up FiveM server on Linux and Windows (FXServer)

> 📘 This content originated from JavaPipe's website. JavaPipe has now merged with [Mochahost](https://mochahost.com/), providing an improved range of hosting services with added benefits and dependable service quality. Check out the fastest hosting plans here: [Managed Linux VPS](https://mochahost.com/dedicated-servers)

# Setting Up FiveM Server on Windows VPS or Linux VPS

FiveM server can be set up on both[ Windows VPS](https://javapipe.com/windows-vps/) and[ Linux VPS plans](https://javapipe.com/kvm-vps/). [JavaPipe ](https://javapipe.com/)recommends the Linux option due to its resource efficiency, ability to handle more traffic, and easier mitigation of DDoS attacks.

## FiveM on [Windows VPS](https://javapipe.com/windows-vps/)

### Requirements:

* [Visual C++ Redistributable 2019](https://aka.ms/vs/16/release/VC_redist.x64.exe) or newer
* [Git ](https://git-scm.com/download/win)for correct installation

### Installation Steps:

1. Create a new folder (for example` D:\\FXServer\\server`).

2. Download the latest `master` branch build for Windows from the artifacts server.

3. Extract the build into the directory previously created, using any archiving tool (WinRAR or 7-zip).

4. Clone cfx-server-data in a new folder outside of your server binaries folder, for example, `D:\\FXServer\\server-data`.\
   4b. `git clone https://github.com/citizenfx/cfx-server-data.git server-data`

5. Make a server.cfg file in your server-data folder (copy the [example server.cfg ](https://docs.fivem.net/docs/server-manual/setting-up-a-server/#servercfgexample)file below into that file).

6. Generate a license key at [https://keymaster.fivem.net](https://keymaster.fivem.net).

7. Set the license key in your server.cfg using sv\_licenseKey "your\_license\_here".

8. Run the server from the server-data folder. For example, in a plain Windows command prompt (cmd.exe) window:

cd /d D:\FXServer\server-data\
D:\FXServer\server\FXServer.exe +exec server.cfg

## FiveM on \[Linux VPS]

1. On a new folder (for example mkdir /home/username/FXServer/server), download the latest master branch build for Linux from the [artifacts server](https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/) (copy the URL for the latest server version and use wget \<url> to download it).
2. Extract the build to the directory that was previously created, using cd /home/username/FXServer/server && tar xf fx.tar.xz (you need to have xz installed, on Debian/Ubuntu this is in the xz-utils package).
3. Clone [cfx-server-data](https://github.com/citizenfx/cfx-server-data) in a new folder outside of your server binaries folder.\
   4b. For example `git clone https://github.com/citizenfx/cfx-server-data.git /home/username/FXServer/server-data`
4. Make a server.cfg file in your server-data folder (copy the [example server.cfg](https://clients.javapipe.com/knowledgebase/170/How-to-set-up-FiveM-server-on-Linux-and-Windows-FXServer.html#servercfgexample) file below into that file).
5. Generate a license key at [https://keymaster.fivem.net](https://keymaster.fivem.net).
6. Set the license key in your server.cfg using sv\_licenseKey "yourLICENSEhere".
7. Run the server from the server-data folder.\
   8b. `bash /home/username/FXServer/server/run.sh +exec server.cfg`

## Common Issues:

* If you don't get any ‘resources found’, and it says ‘Failed to start resource’, you didn't ‘cd’ to the right folder.- If no resources start and you can't connect, ensure you added `+exec`.
* If no resources get started, and you can't connect, you didn't add +exec.
* If you get ‘no license key was specified’, one of the above things applies.

## Example server.cfg

An example server.cfg file is provided below:

# Configuration for FiveM Server
