Setting up a custom server

Discussion in 'PA: TITANS: General Discussion' started by flubbateios, April 11, 2018.

  1. flubbateios

    flubbateios Active Member

    Likes Received:
    The exodus esports guide is outdated since it uses the old and soon-to-be deprecated PA Stats API.

    I'm using debian "stretch".

    First, check that you have the papatcher dependencies:
    $ python3
    Python 3.5.3 (default, Jan 19 2017, 14:11:04)
    >>> import pycurl
    We will need to install some stuff now.

    Update your package lists:
    sudo apt-get update
    Install an opengl library:
    sudo apt-get install libgl1-mesa-glx
    If you got an error on "import pycurl", we need some additional things:
    sudo apt-get install python3-pip
    sudo pip3 install pycurl
    Now that we have our dependencies installed, we can install PA.
    wget "" -O
    python3 -u YOUR_UBERNAME -p YOUR_PASSWORD -s stable --unattended
    It's now time to start the server. To ensure that it stays up after each game finishes, we'll need to make a short bash script to startup the server.

    while true;do
        "$HOME/.local/share/Planetary Annihilation/stable/server" \
        --allow-lan \
        --game-mode "PAExpansion1:lobby" \
        --server-name "Your server name" \
        --enable-crash-reporting \
        --mt-enabled \
        --max-players 32 \
        --max-spectators 5 \
        --output-dir "/data/replays" \
        --replay-filename "UTCTIMESTAMP" \
        --replay-timeout 10 \
        --gameover-timeout 30 \
        --headless  \
        --community-servers-url "auto" --community-server-region "your_server_region" \
        --server-password "your_server_password";
        sleep 2;
    Some explanation on some of the options:

    --game-mode must be either "lobby" or "PAExpansion1:lobby" (the latter is for TITANS)
    --mt-enabled enables multithreading
    --output-dir is where replays are saved (/data/replays is just an example)
    --replay-filename is the format of the replay file name. It should be left on UTCTIMESTAMP. I don't know of any other formats.
    --replay-timeout is the amount of time in seconds for the replay to be saved after the game ends
    --gameover-timeout is the amount of time in seconds for the server to shutdown after the game ends
    --headless prevents a window from being opened
    --community-servers stuff is for the community server feed

    Save this somewhere with your favourite text editor. I'm going to save it as Make sure you can execute it, then start the server.
    chmod +x
    nohup ./ & disown
    If you need to kill the script that's starting the server after each game (replace PID with the PID that you find from ps -aux):
    ps -aux | grep startpa
    kill PID for more info.

    Since ~June 2018, custom servers (other than PA Inc's community dedicated servers) no longer show up on the public server browser. To connect to one of these servers you'll have to use wondible's Connect Buttons mod.
    Last edited: January 8, 2020
    Clopse, dukyduke, veracious3 and 7 others like this.
  2. dukyduke

    dukyduke Active Member

    Likes Received:
    Thank you !

    It's also possible to use apt instead of pip to install pycurl :
    sudo apt install python3-pycurl
    flubbateios likes this.
  3. flubbateios

    flubbateios Active Member

    Likes Received:
    It's actually on debian stretch by default but this guide should apply to other distros :).

    I don't know which is faster: pip or apt for pycurl.

    I've opted for steam servers for my script since they're significantly faster for downloading PA.
    Last edited: April 18, 2018
    dukyduke likes this.
  4. flubbateios

    flubbateios Active Member

    Likes Received:
  5. Quitch

    Quitch Post Master General

    Likes Received:
    Updated eXodus guide to point to this guide.

Share This Page