- Download
setup.sh
and replaceSTEAM_KEY
with your key and update any versions you want. - Run
setup.sh
. - Replace
mods.json
with one provided here. - Create service file by copying file here to
/etc/systemd/system/screeps-world.service
. - Enable and run service (
systemctl enable screeps-world && systemctl start screeps-world
). - Log into the cli (
su screeps && cd ~/world && ./node_modules/screeps/bin/screeps.js cli
). - Reset memory (
system.resetAllData()
) and restart (systemctl restart screeps-world
.
Last active
January 28, 2019 23:26
-
-
Save tedivm/c390913852475852ea2364b93b9eb660 to your computer and use it in GitHub Desktop.
Screeps Private Server Setup (Ubuntu, Mongo, Redis)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"mods": [ | |
"node_modules/screepsmod-mongo/index.js", | |
"node_modules/screepsmod-auth/index.js", | |
"node_modules/screepsmod-tickrate/index.js", | |
"node_modules/screepsmod-admin-utils/index.js", | |
"node_modules/screepsmod-features/index.js" | |
], | |
"bots": { | |
"simplebot": "node_modules/@screeps/simplebot/src" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Screeps Server (world) | |
Wants=network-online.target | |
After=network-online.target | |
[Service] | |
Type=simple | |
WorkingDirectory=/home/screeps/world | |
ExecStart=/home/screeps/world/node_modules/screeps/bin/screeps.js start | |
User=screeps | |
Group=screeps | |
[Install] | |
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
STEAM_KEY=fillthisin | |
WORLD=world | |
MONGO_VERSION=3.6 | |
MONGO_PUBLIC_KEY=2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5 | |
NODE_VERSION=8 | |
UBUNTU_VERSION=xenial | |
# Install prerequisites | |
apt install -y build-essential tcl software-properties-common | |
# Install Node | |
curl -sL https://deb.nodesource.com/setup_${NODE_VERSION}.x | sudo -E bash - | |
apt install -y nodejs | |
# Install Mongo | |
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv $MONGO_PUBLIC_KEY | |
echo "deb http://repo.mongodb.org/apt/ubuntu ${UBUNTU_VERSION}/mongodb-org/${MONGO_VERSION} multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-${MONGO_VERSION}.list | |
apt update | |
apt-get install -y mongodb-org | |
systemctl start mongod | |
systemctl enable mongod | |
# Install redis | |
add-apt-repository ppa:chris-lea/redis-server | |
apt update | |
apt install redis-server | |
# Create screeps user and setup server | |
adduser --disabled-password --gecos "" screeps | |
su -m screeps -c " | |
mkdir ~/${WORLD}; | |
cd ~/${WORLD}; | |
npm install screeps; | |
yes ${STEAM_KEY} | ./node_modules/screeps/bin/screeps.js init; | |
npm install screepsmod-mongo screepsmod-auth screepsmod-tickrate screepsmod-admin-utils screepsmod-features; | |
" |
Thanks, this is great! Two problems though:
- I'm not sure why, but when I install all the mods packages, it removes the screeps package itself, forcing me to have to reinstall the screeps package again.
- The service won't actually start. The
screeps.js start
command is throwing an error saying that it can't callmkdir
.
Jan 28 17:20:56 zilbot screeps.js[647]: at Promise.promise.promiseDispatch (/home/screeps/world/node_modules/q/q.js:816:13)
Jan 28 17:20:56 zilbot screeps.js[647]: at /home/screeps/world/node_modules/q/q.js:624:44
Jan 28 17:20:56 zilbot screeps.js[647]: at runSingle (/home/screeps/world/node_modules/q/q.js:137:13)
Jan 28 17:20:56 zilbot screeps.js[647]: at flush (/home/screeps/world/node_modules/q/q.js:125:13)
Jan 28 17:20:56 zilbot screeps.js[647]: at _combinedTickCallback (internal/process/next_tick.js:132:7)
Jan 28 17:20:56 zilbot screeps.js[647]: at process._tickCallback (internal/process/next_tick.js:181:9)
Jan 28 17:20:56 zilbot screeps.js[647]: errno: -13,
Jan 28 17:20:56 zilbot screeps.js[647]: code: 'EACCES',
Jan 28 17:20:56 zilbot screeps.js[647]: syscall: 'mkdir',
Jan 28 17:20:56 zilbot screeps.js[647]: path: '/home/screeps/world/logs/1548717656041' }
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for this its helped a lot.
A couple of points that didnt work for me.
But overall very helpful.