This repository allows you to create a Quake 3 DeFrag server with minimal efforts, with the help of Docker, or manually if you're brave enough.
Due to very strict foldernames required for this project, please clone this repository using this command:
git clone https://github.com/Defrag-racing/defrag-server-bundle.git ./dfsv- A 64 bit Debian-based Linux system
- 150MB of RAM per server
- Around 2GB of free storage
- NFS client support (
nfs-commonpackage)
- Make sure Docker is installed.
- Create a regular user called
q3df(very important). - Make sure the
q3dfuser has permissions to get thedockergroup. (sudo usermod -aG docker q3df). - Log as
q3dfandgit clonethis repository. - Inside the folder, build the docker image (
docker build -t q3df .). - As
q3df, run./download_defrag.shto download all required files for defrag. - Once done, configure
sv.confto your likings. - Run
generate_docker_service.shto generate adocker-compose.override.ymlfile. Review the data if necessary. - Run
docker compose up -dto run it in the background. Test if everything works properly by connecting to your server.
- Create a regular user called
q3df(very important), log into that user andgit clonethis repository. - As root, run
./.localinstall/install.shto install all required packages. - As
q3df, run./download_defrag.sh - Configure
sv.confto your liking. - Once done, run
./start-servers.shto and verify if there are indeed screens (screen -rshould redirect you to the quake 3 console). - Try connecting to your server on your defrag client (
connect ip:portin the console) to see if you can join it. - As root, make a symlink of the NFS mount for custom maps (
sudo ln -s /home/q3df/dfsv/.localinstall/home-q3df-game-nfs-maps.mount /etc/systemd/system/home-q3df-game-nfs-maps.mount) and start the service (systemctl enable home-q3df-game-nfs-maps.mount && systemctl start home-q3df-game-nfs-maps.mount) - As root, make a symlink of the dfsv service to run it after each reboot (
sudo ln -s /home/q3df/dfsv/.localinstall/dfsv.service /etc/systemd/system/dfsv.service) and start the service (systemctl enable dfsv.service && systemctl start dfsv.service) - GLHF :)
- ssh into your instance
- run
cd ~/dfsv - run
nano sv.conf
- To set a permanent hostname, rcon, admin, and location, fill in the information in the first block
- To make your server private, modify the "Server privacy" block. Set SV_PRIVATE to 1 and replace the default password to the desired one
- To control how many and what types of servers to deploy, modify the "Server counts" block. (e.g set
mixed_count=3for 3 mixed servers) - To modify the suffixes (- mixed 1, mixed 2, teamruns 1, etc.) Modify the
Server suffixesblock.
- Once ready, press Ctrl + x
- Type 'y', then press 'Enter'
- rerun
./launch-native.shand to apply changes - run
ps aux | grep oDFe.dedto see your running servers and their ports
After following the previous steps, you will have all current maps from ws.q3df.org on-demand. However, if you'd like to upload custom maps or maps not present in worldspawn, either upload pk3 files directly to baseq3, or :
From your local PC:
- from the machine that contains the desired map, run (from a powershell window or command line):
scp path/to/your/map q3df@ipofyourinstance:~/dfsv/game/baseq3
- Enter your instance's password.
- Restart your server from the game by callvoting the current map.
- Callvote your map
From the instance OS, as user q3df:
- run
cd ~/dfsv/game/baseq3 - run
wget link-to-map - Restart your server from the game by callvoting the current map.
- Callvote your map.
- Once you have all your desired settings, you can create a snapshot for free (at the time of this writeup) on vultr.
- Click on the instance with all your settings
- Go to the 'snapshots' tab
- Create snapshot, enter whatever name suitable.
- Re-do the deployment steps from the beginning of this readme, this type choosing "Snapshot" instead of "64 Bit OS"
- Choose the snapshot with the name you chose in step 4.
- Deploy. Once done installing, everything will be up but in your new location. Try connecting via defrag.
- Destroy unused instances to avoid unecessary billing.
If you are running a Docker server, simply edit the required info within sv.conf.
If you were provided a RSID (More information at https://defrag.racing), this step is REQUIRED for proving runs made online.
- As
q3df, type this command to edit your crontab file :
crontab -eThen at the end of it, copy/paste this command:
*/30 * * * * cd ~/dfsv && bash ./.docker-demoupload/upload_demos.sh
This will automatically send demos to defrag-racing's server every 30 minutes.
You need to actually do a few more steps in order to use this feature, such as having unique rs_IDs, otherwise the server won't run.
Please go to the defrag.racing community for more information.
You might have libraries missing, but most likely libmysqlclient.so.20 on your system. To verify what libraries you might not have, type this :
ldd ./game/defrag/qagamei386.soIf it wasn't installed, a .deb package is available inside the .install subdirectory.
If you are running Docker, simply recreate a folder named .q3a within the game folder.
If you are not running Docker, create a folder named .q3a within your $HOME directory.
If you do not have a server ready, you can rent a VPS:
Options:
- https://www.vultr.com/ < cheap and good quality
- https://aws.amazon.com/
- https://azure.microsoft.com/en-us/
- https://www.digitalocean.com/
- https://www.linode.com/
I will show the steps for vultr, as it is the easiest to set up.
- Sign up
- Click on the big '+' sign or find "Deploy New Server"
- Choose "Cloud Compute"
- Choose desired location
- Choose 64 Bit Ubuntu (latest version)
- Choose the $5/mo option (1 CPU 1 Mb RAM). (Billed per hour of usage)
- Click on "Deploy Now". Wait for server to finish installing
- Once finished, click on the instance to see the details. You will see ip, username, and password.
- From a Powershell window (should be installed in your windows already) or command line, execute the following command:
ssh root@ipofyourinstance- Enter the password, proceed to next section.
- frog for its original work.
- Ch0wW for rewriting parts of the project for defrag.racing.