> For the complete documentation index, see [llms.txt](https://fairshieldac.gitbook.io/farishieldac-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fairshieldac.gitbook.io/farishieldac-docs/getting-started/installation-guide.md).

# Installation Guide

Install FairShield on your server in just a few minutes.

### Step 1: Download

Download the latest version of FairShield from your dashboard: [Download FairShield.](https://my.fairshieldac.com/download)

### Step 2: Upload Files

Upload the FairShield folder to your server resources directory.

```bash
# Server structure
/resources
  /FairShieldAC
    .key
    .yarn.installed
    client.lua
    cl-sr.lua
    fxmanifest.lua
    guide.md
    sc.js
    index.html
    index-D88jK22x.js
    index-HaArA_ge.css
    main.js
    server.lua
    server_ws.js
    ws_client.lua
    yarn.lock
```

### Step 3: Configure License

Open the .key file and enter your license key.

```lua
FR-XXXX-XXXX-XXXX-XXXX
```

### Step 4: Add to Server Config

Add FairShield to your server.cfg file.

```bash
# Add this to your server.cfg
ensure FairShieldAC
```

### Step 5: Install FairShield Installer

Install the FairShield Installer by running the following command in your server console.

```bash
fr install
```

After the installer finishes, restart your server to apply the changes.

{% hint style="info" %}
If your server artifact is newer than 25839, you must add `add_unsafe_child_process_permission FairShieldAC` to your server.cfg.
{% endhint %}

### Alternative: Install with a Shell Command (Latest Artifacts)

On the latest FiveM artifacts, the sandbox blocks fr install from writing to other resources. Instead, run one command on your server machine: it adds the FairShield protection line as the first line of every resource manifest in your resources folder, skips FairShieldAC and oxmysql automatically, and is safe to re-run (it only adds the line where it is missing). Stop your server and make a backup of your resources folder first, then follow the tab for your server's OS. When the command finishes it prints a summary of what was installed - then restart your server. Run it again whenever you add or update a resource.

{% tabs %}
{% tab title="Linux" %}

1. Connect to your server over SSH (PuTTY / Terminal). The command will NOT work in the txAdmin or F8 console.
2. Go to your resources folder. Example for txAdmin: cd \~/txData/YourServer.base/resources
3. Copy the command below, paste it into the terminal and press Enter.

```bash
if [ -z "$(find -L . -maxdepth 5 -type d -name FairShieldAC -print -quit)" ]; then echo "ERROR: FairShieldAC not found. Run this inside your resources folder (the anticheat folder must be named exactly FairShieldAC)."; else find -L . -type f \( -name fxmanifest.lua -o -name __resource.lua \) ! -ipath "*/fairshieldac/*" ! -ipath "*/oxmysql/*" -exec grep -LZF "@FairShieldAC/_installer.lua" {} + | xargs -0 -r sed -i --follow-symlinks "1s|^\(\xEF\xBB\xBF\)\?|\1shared_script '@FairShieldAC/_installer.lua'\n|"; echo "Done. Shim now present in $(grep -RlF "@FairShieldAC/_installer.lua" --include=fxmanifest.lua --include=__resource.lua . | wc -l) manifests."; fi
```

{% endtab %}

{% tab title="Windows" %}

1. Open your resources folder in Windows Explorer, click the address bar, type powershell and press Enter. PowerShell opens directly in that folder. Do NOT use Command Prompt (cmd).
2. Copy the command below, paste it into the PowerShell window (right-click pastes) and press Enter.

```powershell
if(-not (Get-ChildItem . -Recurse -Directory -Filter FairShieldAC -ErrorAction SilentlyContinue)){ "ERROR: FairShieldAC not found. Run this inside your resources folder (the anticheat folder must be named exactly FairShieldAC)." } else { $q=[char]39; $n=0;$a=0;$f=0; Get-ChildItem . -Recurse -File -Force -Include fxmanifest.lua,__resource.lua -ErrorAction SilentlyContinue | ForEach-Object { $fp=$_.FullName; if($fp.Substring($PWD.Path.Length) -match '\\(FairShieldAC|oxmysql)\\'){ return }; $it=$_; $b=$null; try { $b=[IO.File]::ReadAllBytes($fp); if([Text.Encoding]::UTF8.GetString($b).Contains("@FairShieldAC/_installer.lua")){ $a++ } else { $i=0; if($b.Length -ge 3 -and $b[0] -eq 239 -and $b[1] -eq 187 -and $b[2] -eq 191){$i=3}; $s=[Text.Encoding]::UTF8.GetBytes("shared_script $q@FairShieldAC/_installer.lua$q`r`n"); $m=New-Object IO.MemoryStream; $m.Write($b,0,$i); $m.Write($s,0,$s.Length); $m.Write($b,$i,$b.Length-$i); if($it.IsReadOnly){$it.IsReadOnly=$false}; [IO.File]::WriteAllBytes($fp,$m.ToArray()); $n++ } } catch { $f++; Write-Warning "FAILED: $fp ($_)" } }; "Done. Installed: $n | already had it: $a | failed: $f" }
```

{% endtab %}
{% endtabs %}

#### Removing the Shim (Uninstall)

To revert, run the matching command from inside your resources folder (server stopped). It deletes only the FairShield shared\_script line from every manifest - nothing else in your files is changed. Run this BEFORE deleting the FairShieldAC folder, otherwise your resources will error on the missing reference.

{% tabs %}
{% tab title="Linux" %}

```bash
find -L . -type f \( -name fxmanifest.lua -o -name __resource.lua \) -exec grep -lZF "@FairShieldAC/_installer.lua" {} + | xargs -0 -r sed -i --follow-symlinks "/@FairShieldAC\/_installer\.lua/d"; echo "Removed. Shim still present in $(grep -RlF "@FairShieldAC/_installer.lua" --include=fxmanifest.lua --include=__resource.lua . | wc -l) manifests (should be 0)."
```

{% endtab %}

{% tab title="Windows" %}

```powershell
$r=0; Get-ChildItem . -Recurse -File -Force -Include fxmanifest.lua,__resource.lua -ErrorAction SilentlyContinue | ForEach-Object { $fp=$_.FullName; $it=$_; $t=$null; try { $e=[Text.Encoding]::GetEncoding(28591); $t=$e.GetString([IO.File]::ReadAllBytes($fp)); if($t.Contains("@FairShieldAC/_installer.lua")){ $u=($t -split "(?<=`n)" | Where-Object { $_ -notlike "*@FairShieldAC/_installer.lua*" }) -join ''; if($it.IsReadOnly){$it.IsReadOnly=$false}; [IO.File]::WriteAllBytes($fp,$e.GetBytes($u)); $r++ } } catch { Write-Warning "FAILED: $fp ($_)" } }; "Removed the shim from $r manifests."
```

{% endtab %}
{% endtabs %}

### Step 6: Restart Server

Restart your server and FairShield will be active.

{% hint style="success" %}
**Installation Complete**

After installation, check your server console for the "Anti-cheat system initialized successfully!" message.
{% endhint %}

{% hint style="info" %}
By using the following ACE\_Permission, you can whitelist the admin group for being interrupted&#x20;
{% endhint %}

```
add_ace group.admin FairShield.Bypass allow
```
