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

# Linux Server Setup

> Guide for setting up a Longvinter server on Linux.

<Note>If you have any trouble following this guide, please send us a message on [Discord](https://discord.gg/longvinter) or the [Uuvana Forums](https://forum.uuvana.com/t/longvinter-questions-and-help). We are more than happy to help you out!</Note>

## Requirements and Pre-requisites

* Min. 2 GB RAM
* Min. 64-bit Linux Operating System
* Min. CPU with least 3GHz clock speed
* Broadband internet connection
* Router with the ability to port forward
* SteamCMD installed in your system

<Warning>Some ISPs might not allow you to port forward. In such case, we recommend you to purchase VPS / Dedicated Server services.</Warning>

## Installing Server

<Steps>
  <Step title="System Setup" icon="user-plus">
    ### Creating user and group to run the server

    ```shell theme={null}
    sudo useradd -m -d /home/steam steamcmd
    sudo passwd steamcmd
    sudo usermod -aG sudo steamcmd
    sudo su steamcmd
    ```

    ### Installing SteamCMD

    <Tabs>
      <Tab title="Ubuntu/Debian">
        ```shell theme={null}
        sudo apt update
        sudo apt install lib32gcc-s1 steamcmd
        ```
      </Tab>

      <Tab title="Arch">
        ```shell theme={null}
        sudo pacman -Sy
        git clone https://aur.archlinux.org/steamcmd.git
        cd steamcmd
        makepkg -si
        sudo ln -s /usr/games/steamcmd /home/steam/steamcmd
        ```
      </Tab>

      <Tab title="Fedora">
        ```shell theme={null}
        sudo yum update
        sudo yum install steamcmd
        ```
      </Tab>
    </Tabs>

    ### Making directory for Longvinter server

    ```shell theme={null}
    sudo mkdir longvinter-server
    ```
  </Step>

  <Step title="Steam CMD Setup" icon="steam">
    ```shell theme={null}
    cd ~/
    mkdir steamcmd
    cd steamcmd
    wget https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz
    tar -xvzf steamcmd_linux.tar.gz
    ```
  </Step>

  <Step title="Configure Port-forwarding and Firewalls" icon="block-brick-fire">
    <Warning>In other tutorials it is asked to open the TCP Port, do not do it. Unreal Engine doesn't use TCP connections.</Warning>

    <Info>If you are opening multiple servers on the same network, configure firewall accordingly.</Info>

    <Tabs>
      <Tab title="IPTables">
        ```shell theme={null}
        sudo iptables -I INPUT -p udp --dport 7777 -j ACCEPT
        ```
      </Tab>

      <Tab title="Uncomplicated Firewall (UFW)">
        ```shell theme={null}
        sudo ufw allow 7777/udp
        ```
      </Tab>
    </Tabs>
  </Step>

  <Step title="Install Longvinter Server" icon="download">
    ```shell theme={null}
    cd ~/longvinter-server
    steamcmd +force_install_dir . +login anonymous +app_update 1639880 validate +quit
    ```
  </Step>

  <Step title="Customize the Server" icon="gear">
    ```shell theme={null}
    nano ~/longvinter-server/Longvinter/Saved/Config/LinuxServer/Game.ini
    ```

    Add the following content and configure:

    ```ini theme={null}
    [/Game/Blueprints/Server/GI_AdvancedSessions.GI_AdvancedSessions_C]
    ServerName=[EU-WEST] Arlo's Hangout
    ServerMOTD=Welcome to Arlo's Hangout
    MaxPlayers=64
    Password=
    CommunityWebsite=discord.gg/longvinter
    CoopPlay=false
    CheckVPN=true
    CoopSpawn=0
    Tag=none
    ChestRespawnTime=900
    DisableWanderingTraders=false

    [/Game/Blueprints/Server/GM_Longvinter.GM_Longvinter_C]
    AdminSteamID=00023652dd9b4673be20d4f83ab42c5b 0002365d948ad82f373be20d4ff8ab42c5b
    PVP=false
    TentDecay=true
    MaxTents=3
    RestartTime24h=6
    SaveBackups=true
    ```

    <Card title="Configuration" icon="gear" href="/server/configuration">
      Check out configuratioin page for detailed informations.
    </Card>
  </Step>

  <Step title="Run the Server" icon="play">
    <Tabs>
      <Tab title="Manual Start">
        ### Start the server manually

        ```shell theme={null}
        cd ~/longvinter-server
        ./LongvinterServer.sh
        ```
      </Tab>

      <Tab title="Automatic Start (Recommended)">
        ### Start the server automatically with Systemd

        Create a systemd service file:

        ```shell theme={null}
        sudo nano /etc/systemd/system/longvinter.service
        ```

        Add the following content:

        ```ini theme={null}
        [Unit]
        Description=Longvinter Server
        After=network.target

        [Service]
        Type=simple
        User=steamcmd
        WorkingDirectory=/home/steam/longvinter-server
        ExecStart=/home/steam/longvinter-server/LongvinterServer.sh
        Restart=on-failure

        [Install]
        WantedBy=multi-user.target
        ```

        Enable and start the service:

        ```shell theme={null}
        sudo systemctl daemon-reload
        sudo systemctl enable longvinter.service
        sudo systemctl start longvinter.service
        ```
      </Tab>
    </Tabs>
  </Step>

  <Step title="Server Maintenance" icon="traffic-cone">
    <Tabs>
      <Tab title="Updating the Server">
        Run the following commands to update your Longvinter server:

        ```shell theme={null}
        cd ~/longvinter-server
        steamcmd +force_install_dir . +login anonymous +app_update 1639880 validate +quit
        ```
      </Tab>

      <Tab title="Backing Up Saves">
        Use this command to create a backup of your server saves:

        ```shell theme={null}
        cp -r ~/longvinter-server/Longvinter/Saved ~/longvinter-backup-$(date +%Y%m%d)
        ```
      </Tab>
    </Tabs>
  </Step>
</Steps>

## Getting Help

<CardGroup cols={2}>
  <Card title="FAQ" icon="question" href="/server/faq">
    Check our server FAQ page to find solutions for common issues.
  </Card>

  <Card title="Discord" icon="discord" href="https://discord.gg/longvinter">
    Ask qeustions in our #dedicated-server-help channel located in our Discord server.
  </Card>
</CardGroup>

<Tip>Please contact **@alvar\_noah** on the [Longvinter Discord](https://discord.gg/longvinter) if there's any errors.</Tip>
