An open source, free-to-play, Unciv multiplayer server written in TypeScript.
To run UncivServer.xyz locally, you would need:
- Git: If you are on Linux then Git should be installed by default. On Windows, install from here.
- Bun: Install from https://bun.sh/
- MongoDB: You can run a local MongoDB instance with
docker run -d --name some-mongo -e MONGO_INITDB_DATABASE=unciv -p 27017:27017 mongo
. Alternatively, you can make a free MongoDB instance with the database nameunciv
from here.
All of your data would be hosted at your MongoDB server. Now clone this project and open the
directory and make a file named .env
.
git clone https://github.com/touhidurrr/UncivServer.xyz.git
cd UncivServer.xyz
# If running via docker, should be `echo "MONGO_URL=mongodb://localhost" > .env`
echo "MONGO_URL=<Your MongoDB URL>" > .env
# Required for sync tests to pass
echo "SYNC_TOKEN=$(openssl rand -base64 32)" >> .env
Now run the following commands to start your server! By default, the server will start at
http://0.0.0.0:3000
, which you can access from http://localhost:3000
from your browser. However,
you can change this behavior setting PORT
and HOST
environment variables in the .env
file you
just made. Note that both of these variables are optional.
bun install
bun start
To start the development server run:
bun dev
Don't forget to lint, format, and test the code before submitting a pull request.
bun lint
bun format
bun test