Setting up Unreal Tournament 2004 Game server on Ubuntu 16.04

Hey everybody.

Been a while since I wrote here. Figured I would write up a howto to setting up a Unreal Tournament 2004 server. I really love this game. It brings back tons of memories, playing this when I was in the Navy with my friends on the sub.

My boys have some break time off from school, and they played a little bit back in the day, so I decided to spin up a server so that we could play. I looked for a way to do this online, and couldn’t find anything so I figured I would write something up, so here you go.

So, the good thing is that because the game is pretty old now, over 13 years old now, it doesn’t really require a lot of CPU or memory or storage. I deployed a KVM with 2 cores and 4GB of RAM and 20GB storage server running Ubuntu 16.04.3, and got all the updates installed. I then spent the next few hours searching for the ut2004 dedicated server package. Never could find it. Luckily, I had a backup copy, which I have uploaded to this server so you can download it here. You’ll also need the patch, which you can download here.

I created a directory for the game in /usr/local/games/UT2004 and extracted the .zip here:

sudo unzip -d /usr/local/games/UT2004 dedicatedserver3339-bonuspack.zip

Once that was complete, I then untarred the patch and had to manually install it, since it creates a directory called UT2004-Patch so I had to actually go into each directory and move the files into their respective directories in the UT2004 directory. Once that was complete, you now have a system capable of running Unreal Tournament 2004 server. However, I needed to do a couple more things.

Next, you need to install libstdc++5 package. This is required so that Unreal can run. Run the following command to install libstdc++5:

sudo apt install libstdc++5

One, I decided to start the web admin. In the /usr/local/games/UT2004/System/UT2004.ini. Find the UWeb.Webserver section and modify it:

[UWeb.WebServer]
Applications[0]=xWebAdmin.UTServerAdmin
ApplicationPaths[0]=/ServerAdmin
Applications[1]=xWebAdmin.UTImageServer
ApplicationPaths[1]=/images
bEnabled=True
ListenPort=80

You can change the ListenPort to what ever you want, you just need to change bEnabled=False to True to enable it.

Next, I decided that I wanted this to run as a service using SystemD instead of just running in the background with me logged in to the server. Below is my UT2004-Server.service file:

[Unit]
Description=Unreal 2004 Dedicated Server
After=network.target

[Service]
Type=simple
User=ut2004
WorkingDirectory=/usr/local/games/UT2004/System
ExecStart=/usr/local/games/UT2004/System/ucc-bin-linux-amd64 server CTF-BridgeOfFate?game=XGame.xCTFGame?AdminName=admin?AdminPassword=XXXXXXXX ini=UT2004.ini log=server.log -nohomedir
Restart=on-abort

Just change the ?AdminPassword= to what you want I then copied the file into /lib/systemd/system and chmod 644 and chown root:root the ut2004-server.service file and now I can control the service with systemctl:

systemctl start ut2004-server.service and I can get status with systemctl status ut2004-server.service

One last thing I did as well is I included my cdkey from my game since I was getting errors about a missing cdkey, however, I have tested it, and it is not required. The game will still run, you just can’t advertise your server on the Internet and host Internet games without it, which means your stats also won’t work. You used to be able to download a CD-Key from Epic, but that service is no longer working. I emailed them about this on December 2, 2017 with no reply as to date.

Happy gaming!


Comments

20 responses to “Setting up Unreal Tournament 2004 Game server on Ubuntu 16.04”

  1. An impressive share! I’ve just forwarded this onto a co-worker who had been conducting a little homework on this. And he in fact ordered me dinner because I found it for him… lol. So let me reword this…. Thank YOU for the meal!! But yeah, thanks for spending some time to talk about this matter here on your website.

  2. Thanks for the guide and for the downloads. They were very helpful in getting this set up.

    In my case I ran into this while running the server
    > error while loading shared libraries: libstdc++.so.5:
    But was able to solve it with
    > sudo apt-get install libstdc++5

    Leaving this here in case anyone else finds it useful.

  3. Thank you for the write up and the download links. It was helpful in setting up my own server.

    In case it is useful for anyone else, I hit the error
    “error while loading shared libraries: libstdc++.so.5:”
    and resolved it with
    “sudo apt-get install libstdc++5”

    1. wililupy Avatar
      wililupy

      Excellent point. I will modify it. Thanks!

  4. Hey, just wanna say thanks for this. I’m building a small home NAS that will also function as a UT2004 server, and this should be everything I need. Thanks!

    1. Thanks for the comment! Glad this could help!

  5. thanks im leeching a copy now and i did find a cdkey online for servers, apparently can use a key for many servers without issue, will see if it works.

  6. Super helpful! The only thing I haven’t quite figured out is when I run it via systemd (with a new user I created with “useradd” named “ut2004”), I can’t access the ServerAdmin. If I run it normally under “root” it works just fine. Any insight as to what I need to give my user access to for this to work?

    Great tutorial! I had this up and running in AWS Lightsail in about 30 minutes!

    1. wililupy Avatar
      wililupy

      That’s outstanding! In your config for your webserver for UT2004, make sure you have the password and username setup and you should be able to login via a web interface and use the port you specify. I always caution not to use root since if it is every compromised, someone can have full access to your server.
      Happy gibbing!

    2. Cyborgcnc Avatar
      Cyborgcnc

      the ucc-bin-linux-am64 file does not work very well with 64 bit systems. There is a known issue, in that if you use the WebAdmin interface, and then you change maps, the webserver port will fail to bind. So the webinterface will work initially, then it will stop, unless you restart the server. To fix this, you need to simply just use the 32 bit binary, which is simply ucc-bin. You will get an error when running this however, cause you need the library, and you need to enable the i386 system/architecture. To take care of this, do this:
      sudo dpkg –add-architecture i386
      sudo apt-get update
      sudo apt-get install libstdc++5:i386

      Modify your service file if you like, or simply start from command line, again using just the ucc-bin file and NOT the ucc-bin-linux-amd64 file. All will be good with the world!!

  7. Fantastic guide! Thanks for all your work!

    I’m currently working on setting this up on a new Ubuntu Server 20.04 vm. I can start the service and everything seems ok, but I cannot access the web interface at all. I double verified UFW is allowed on the specified port and that it’s set correctly in ut2004.ini, but no dice for me so far. Also I do get the cdkey error, but there seems to be zero way around this in 2020. I’ve pinged the Epic Community Manager Flak on twitter, we’ll see if she responds.

    I’ve heard you can use any UT2004 key for the server – any idea how to implement the key? I read it’s done via a .reg file, but idk how to generate that file or where to place it.

    Thanks again! Hope you and yours are well!

  8. Thanks for this guide. Two things:
    1. Can you please add a torrent file for those two download links (and also copy-paste what the magnet-link is)? It’s just that it is the apocalypse, so one best be prepping (muh bunker). It could be for qbitTorrent or the new libretorrent2 or whatever you find works best. Fling into it the text of your written guide too. That way if the zombies get you and your server, forever in our hearts will live on a greener pasture of middle England which is your ut2004 linux guide.
    2. Can you also confirm (via update to the article) if this all still works on 20.04lts and if there are any xubuntu subtlties? I see a commenter has a serial-number bug even while owning an original DVD/CDROM. Do keep this 16.04 version up too though as it helps 32bit people. A vanilla debian guide and slackware guide for it all would be awesome tbh. So maybe that is 3 things, tbh.
    IMO: It would be cool to future-proof it all even further by running the ut2004 IRC through PidginIM alongside an xmpp social-media such as movim or whatever a person self-hosts (just as long as it is proper FOSS/FLOSS rather than telegram or discord). All this in that torrent, cheers.
    As an aside: I believe the original UT server (irrespective of ut2004) in software mode could be run on a pi3b debian blob, even if by sluggish qemu (or maybe dosbox). A much better use for retro-pi than emulating old console games.

  9. Anyone able to help me out getting the server up and running on Deb 9? I’m pretty new to linux so struggling….

    1. wililupy Avatar
      wililupy

      I haven’t tried this on Debian 9, but since Ubuntu is a fork of Debian, this should work. What errors are you hitting?

  10. Kitsep Avatar
    Kitsep

    Very detailed and clear! Thank you! I’ll be giving this a shot soon, I’m hosting a vintage LAN party, and UT2K4 is the newest game on the roster. Thank you very much, and I’m sure my friends will enjoy it!

  11. Very energetic article, I liked that bit. Will there be a part 2?

  12. I would like to make a copy of this page to preserve it. in case you ever take it down or heaven forbid something happens to you.

  13. Here are my errors on Ubuntu 22.04

    root@ut2k4:~# cd /usr/local/games/UT2004/System
    root@ut2k4:/usr/local/games/UT2004/System# ./ucc-bin-linux-amd64 server DM-Rankin?game=XGame.xTeamGame ini=servernomasterserverRunGun.ini
    Executing Class Engine.ServerCommandlet
    Assertion failed: sizeof(*this)==GetClass()->GetPropertiesSize() [File:UnGame.cpp] [Line: 148]
    Executing UObject::StaticShutdownAfterError
    Assertion failed: sizeof(*this)==GetClass()->GetPropertiesSize() [File:UnGame.cpp] [Line: 148]

    History:

    Exiting due to error
    Exiting.
    FileManager: Reading 0 GByte 1 MByte 117 KByte 827 Bytes from HD took 0.003920 seconds (0.000633 reading, 0.003287 seeking).
    FileManager: 0.000000 seconds spent with misc. duties
    Name subsystem shut down

  14. I Figured out my issues.
    I needed to take the 2 sets of linux server files attached to this documentation and treat them as a patch and place them on top of my windows server files and everything worked just fine.

  15. It is in reality a nice and helpful piece of information. I’m
    glad that you shared this helpful information with us.

    Please stay us up to date like this. Thank you for sharing.

Leave a Reply to Delbert Dalla Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.