The Screeps:World server uses pretty outdated technologies which is a huge headache when you want to set up a private server at the present day. This is a documentation of how I managed to get the server up and running without relying on the Steam GUI version.
I am using Ubuntu in Windows Subsystem Linux for this server. Install the following prerequisites for the server and take note of the exact versions needed since they are mostly outdated.
- Node v10.24.1 (I recommend
nvm
for this: https://github.com/nvm-sh/nvm) - Python v2.7.18 (I recommend
pyenv
for this: https://github.com/pyenv/pyenv) build-essential
v12.9ubuntu3 (Newer/older versions might be fine, but beware of compile errors due to different gcc versions) (Install withsudo apt install build-essential
)
# Create a folder
mkdir screeps-server
# Enter the folder
cd screeps-server
# Initialize npm to install packages
# Simply press enter until the command finishes
npm init
# Install isolated-vm, which is a dependency of screeps
npm install isolated-vm@^2
# Install screeps without running build scripts
# We need to make some changes before compiling
npm install screeps --ignore-scripts
This is a fix for screeps/screeps#145
Use your editor of choice to add #include <limits>
to the top of node_modules/@screeps/driver/native/src/pf.h
vim node_modules/@screeps/driver/native/src/pf.h
npm rebuild
Ref: https://github.com/screeps/screeps
# Enter your Steam API key here
npx screeps init
# Start the server
npx screeps start
# In another terminal, gain access to server console using this command
npx screeps cli
Enjoy!