Working dedicated server on Debian 8.6 x64

  • Got it working on Debian x64. I want to share my scripts how I did it, it is like @coteyr said here but more detailed.

    ## Set up dedicated screeps server.
    # Tested only on Debian 8.6 x64 with 512mb.

    ## Dependencies
    # To install steam, see
    sudo apt-get install unzip git build-essential

    ## Setup node
    # Probably not the simplest way but it works.
    # Remove everything related to node, so that `node`, `nodejs`, `npm`, `n` or `node-gyp` is not found.
    curl -sL | sudo -E bash
    sudo aptitude install -y nodejs
    sudo npm install npm@latest -g
    sudo npm install node-gyp@latest -g
    node -v # v6.9.1
    npm -v # 3.10.9
    node-gyp -v # v3.4.0

    ## Create user who will run server
    adduser screeps
    sudo su screeps
    # get ~/ from your steam developer account. It has to be v1.37!

    ## Set variables

    ## Setup greenworks
    cd ~
    git clone
    cd greenworks/deps/
        unzip ~/
        mv sdk steamworks_sdk
      cd ..
      npm install # if errors, do you have correct version of node and SDK?

    ## Setup steamcmd
    rm -rf steamcmd
    mkdir ~/steamcmd
    cd ~/steamcmd
      tar -xvzf ../steamcmd_linux.tar.gz

    ## Setup screeps for first time. It will ask password and always slows for 5-15min in the middle of download.
    ~/steamcmd/ +force_install_dir ~/screeps +login $STEAM_USER +app_update 464350 -beta Server -betapassword $BETA_INVITE_CODE validate +exit

    ## Setup config: add steam_api_key from
    cd ~/screeps/server/
    nano .screepsrc

    ## Setup launch scripts.
    echo '#!/bin/bash
    cd ~/steamcmd/
    ./ +force_install_dir ~/screeps +login '$STEAM_USER' +app_update 464350 -beta Server -betapassword '$BETA_INVITE_CODE' validate +exit
    cd ~/screeps/server
    cp ~/greenworks/build/Release/greenworks-linux64.node ~/screeps/server/modules/backend/greenworks/lib/greenworks-linux64.node
    for M in modules/*/
    pushd $M
    rm node_modules -Rf
    npm install
    npm build
    pushd modules/driver/native/
    node-gyp configure
    node-gyp build
    rm logs/* -Rf
    node modules/launcher/bin/screeps.js start' > ~/
    chmod +x ~/

    echo '#!/bin/bash
    cd ~/screeps/server
    node modules/launcher/bin/screeps.js start' > ~/
    chmod +x ~/

    ## Start server!
    # ~/

  • Nice, will try this to recreate it on RaspberryPi. Thanks for posting

    update1: Raspbian doesnt support steam's architecture, retry with just debian.

  • I got this working on Raspberry Pi 3, woo!
    I had to modify backend/lib/game/server.js and backend/lib/game/api/auth.js to comment out the greenworks API calls.


    // try {
    // if(!greenworks.isSteamRunning()) {
    // throw new Error('Steam is not running');
    // }
    // if(!greenworks.initAPI()) {
    // throw new Error('greenworks.initAPI() failure');
    // }
    // console.log("Connected to local Steam client, using native authentication");
    // useNativeAuth = true;
    // }
    // catch(e) {
    // console.log("Connecting to local Steam client failed:", e.message);

    // Need these lines to use Steam Web API
    console.log("Using Steam Web API authentication instead");
    if (!process.env.STEAM_KEY) {
    throw new Error('STEAM_KEY environment variable is not set!');
    useNativeAuth = false;
    // }


    if(request.body.useNativeAuth) {
    if(!useNativeAuth) {
    return q.reject('authentication method is not supported');
    // Removed greenworks auth stuff... do we need to do something else?


    ...but now all my rooms are red and I can't choose a spawn... possibly because I can't set a password?