There are two different type how to start a screeps server.
If you do not have an existing server directory, just start the Docker container with the command line argument init
, and everything gets done for you. The LOCAL_UID
environment variable ensures that the files that are created in the mounted volume have the correct owner set. You can enter any valid (host) uid here or use $(id -u)
to use the current uid of the logged in user.
docker run --rm -it -v $PWD:/screeps -e LOCAL_UID=$(id -u) -e STEAMKEY=YOUR_STEAM_KEY_HERE qnimbus/docker-screeps init
Now it's all set to run the Screeps server.
Make sure you have a server directory (from aprevious installations or by running the 'init' command above).
You can use 'docker-compose' to start the screeps server, create the screeps_net bridged network and start the redis and mongodb instances.
docker-compose -f docker-compose.yml up -d
If you want to start each container manually follow the steps below.
- Make sure you are in the server directory
- Create the custom bridged network
- Start mongo & redis containers
- Run the server
docker run --rm -it --name screeps --network screeps_net -v $PWD:/screeps -p 21025:21025 -d -e LOCAL_UID=$(id -u) qnimbus/docker-screeps
You need to add the screeps, mongo and redis containers to a custom bridged network so the container names are resolvable via DNS on the individual containers. If you do not have a separate custom bridged network you can create one as follows:
docker network create --attachable -d "bridge" --subnet 172.28.0.0/16 screeps_net
Note: The subnet can be changed to your individual needs as well as the network name ('screeps_net')
docker run --rm --name redis --network screeps_net -d -v redis-volume:/data redis
docker run --rm --name mongo --network screeps_net -d -v mongo-volume:/data/db mongo
This runs screepsmond-mongo by default using the custom_mods.json file. If kept, a new installation requires:
system.resetAllData()
to be ran from the Server CLI (See CLI section below) after installation is complete.
In order to push your code to your private server you need a password (using screepsmod-auth
) for your user. You can configure a password by pointing your browser at
http://[private-server-ip]:21025/authmod/password/
or by typing setPassword('your_password')
into the screeps console when logged in on the screeps client.
Mods can be installed by running:
docker run --rm -v $PWD:/screeps qnimbus/docker-screeps yarn add screepsmod-auth
The CLI can be accessed by running:
docker exec -it screeps npx screeps cli
Stop:
docker stop screeps
Start:
docker start screeps
- Stop the server:
docker stop screeps
- Remove the server:
docker rm screeps
- Remove current image
docker rmi qnimbus/docker-screeps
- Follow Running the server