Starting a UT2004 Server on Ubuntu 20.04 in 2021 (17yrs later)

(Updated Mon Jun 14 12:06:28 AM UTC 2021)

UT2004!

I would say that UT2004 (and UT99) are probably the some most diverse multiplayer games of all time, along with maybe Garry’s Mod, Minecraft, etc. The amount of content and variety just in the base game puts other games to shame.

It’s definitely in my Top 10 games of all time, and not just for nostalgia reasons.

I wanted to figure out how to host a 24/7 server to keep the dream alive/be a server god to an almost dying game (actually its pretty incredible how many players still play even now). Finding out anything about how to do this was pretty uh, all over the place. 16yr old forum thread searching, websites with dead links, outdated info for systems at the time, etc etc etc. So I decided to generalize a lot of the information into one place RIGHT HERE so anyone else crazy enough to do this can get started pretty quick.

(I also set up my own server which you can find more about here)

Linux set up

I’m going to assume you know how to use Linux/bash and know to not run anything under root etc. I’m running this on Ubuntu 20.04 but it really shouldn’t matter (btw did I tell you I usually use Arch?). I ended up making a ut2004 user to own/run everything.

I also blocked any ports that I wasn’t going to use:

sudo ufw default deny
sudo ufw allow http
sudo ufw allow https
sudo ufw allow ssh
sudo ufw allow 7777/udp
sudo ufw allow 7778/udp
sudo ufw allow 7787/udp
sudo ufw allow 7788/udp
sudo ufw allow 28902/tcp
sudo ufw allow 8080/tcp
sudo ufw enable

UT2004 also needs some 32-bit libs to run, given how old it is.

First one you can’t find on Ubuntu repos, so you have to extract it/copy the lib like this:

https://s3.amazonaws.com/ut2004-files/libstdc%2B%2B5_3.3.6-20~lucid1_i386.deb
dpkg-deb -R libstdc++5_3.3.6-20~lucid1_i386.deb
cp libstdc++.so.5 /usr/lib

The rest you can get with from repos: apt-get install gcc-multilib lib32z1 lib32ncurses6

Game setup

Thankfully someone has uploaded the server files fully patched, so we can just wget/untar it into our home directory with:

wget https://s3.amazonaws.com/ut2004-files/dedicated-server-3339-bonuspack.tar.gz
gzip -d dedicated-server-3339-bonuspack.tar.gz
tar -xvf dedicated-server-3339-bonuspack.tar

That should make a ut-server directory, but we need to fix a few permissions in there:

sudo chown -R ut2004.ut2004 ./*
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;
chmod 755 System/ucc-bin

Now take a look at System/UT2004.ini, and get very very comfortable with it (You can learn more about all the value here). Some settings I would change immediately are:

[Engine.GameReplicationInfo]
ServerName=Wow! I made this server from www.adamzwakk.com!
ShortName=AZS
ServerRegion=0
AdminName=IDDQD
AdminEmail=
MessageOfTheDay=Hello

[Engine.AccessControl]
AdminPassword=YouShouldChangeThis

I would also create/edit System/XAdmin.ini to this, while changing the values:

[XAdmin.xAdminConfigIni]
AdminUsers=(AdminName="utAdmin",Password="utPassword",Privileges=,Groups=("Admin"),ManagedGroups=)
AdminGroups=(GroupName="Admin",Privileges=,GameSecLevel=255)
AdminGroups=(GroupName="MatchSetup",Privileges="Xm",GameSecLevel=240)

If all goes well, now we can start the vanilla game!

cd ut-server/System
nohup ./ucc-bin server DM-Fractal2004?game=XGame.xDeathMatch ini=UT2004.ini -nohomedir > ~/ucc-bin.out &

This will start a Deathmatch game on DM-Fractal2004 (if the map exists), and use your UT2004.ini file, AND the server log will output to ucc-bin.out. You should also be able to go to http://YOUR-IP:8080 and see your XAdmin instance where you can change maps, add bots, add mutators, etc.

Okay I’m done, I can frag now right?

Well, YES! But if you really want to juice this puppy up, you should add some custom content. There are SO MUCH mutators/maps/skins you can add, and a great place to start is Unreal Archive, unless you want to look through ancient forum threads.

The best way to host mods is to… HOST the mods, so anyone who doesn’t have your custom content can also grab it for you. You’ll have to set up an Apache/Nginx server with a userdir module enable with a2enmod userdir, and then place your files in whatever your Document Root is.

I’ve set up a script to do this here. It’s sort of jank, but it also compresses all files with ucc-bin compress so its lightning fast for the users to download.

Okay that’s ACTUALLY It!

You should be able to join your server by going right clicking on any public game, and Entering your IP. I guess they never made a UI to actually enter your IP, jank is fun though, right? Also worth mentioning that you can’t tie your server to a domain, for some reason the client doesn’t resolve it.

Have fun! Let me know if I didn’t explain something right/forgot something/should add details! :)

Some helpful links

Server Setup

Getting the game client to play nice on modern systems