Civ 5 Cloud Server — for Free! — Nice and Simple

Benjamin Jordanou-Bailey
12 min readMay 15, 2021

--

Civilisation V is a legendary 4x strategy game… with notoriously bad Netcode. However, there is a lesser known way to play with your friends that remedies some of the issues;

In this addition to the Nice and Simple series, I’ll help you make your very own dedicated Civilisation V Pitboss server in the cloud, for free!

Some of the reasons you may host a Pitboss server in the cloud in comparison to standard online play or the Giant Multiplayer Robot. may include:

  • A Pitboss server can run on the cloud 24 hours a day, 7 days a week.
  • Players can take turns whenever they want, meaning no-one has to commit 4+ hours to a game in one sitting.
  • Turns are simultaneous meaning everyone takes their turn at the same time, this is beneficial when playing with multiple players. Note: You can also choose to have hybrid turns or sequential turns if you want!
  • Players won’t be replaced by an AI when they disconnect.
  • The turn timer can be set in hours instead of seconds, this allows players additional time to make decisions about the game
  • Players can log into the server just to check their surroundings and plan their next move, even if it’s 5am!

Prerequisites

In this article you’ll learn to make your server using the Oracle Cloud Infrastructure, so you should sign up with them now! There’s no promo code, affiliate link or free trial whatsoever!

Additionally, you’ll need:

  • A Computer with an internet connection (any OS)
  • Time and Patience, especially if you’re new to Linux

The operating system in this article is the one I run: Fedora (Linux). However, if you have Windows, Mac OS or even Android the steps are almost exactly the same.

Step 1 — Setting up your Free Cloud Server

After creating your account and signing in you should see a screen like this:

OCI dashboard

This is the OCI (Oracle Cloud Interface) Dashboard. There are many features here most of which we don’t have to concern ourselves with. Additionally, I won’t be using anything that requires the 30 day free trial in this article, meaning your server can run forever without any costs!

From here you’ll want to press “Create a VM instance” and fill out the details so it looks like mine:

Setting up your VM part 1

Here, you can keep most of the settings default. I recommend changing the name of the Instance and giving your networks some names. Press“edit” to do this.

Choose whatever flavour of Linux you want, however I recommend “Oracle Autonomous Linux” as it’s the easiest to set up. I also personally didn’t have any luck with Ubuntu.

Now this next step is very important! When you scroll down you’ll see that you have to make or upload an “SSH key pair”. Think of SSH keys like real keys. They’ll be used to access your Server so keep your keys safe!

SSH keys, very important!

You should generate an SSH key pair here and download both of the files, save them somewhere you’ll remember on your device. I made a folder for these in my Documents folder.

Windows Users: You will have to convert these keys to a format PuTTY understands later. If you know how to, you can choose to generate a key pair using PuTTY at this step and upload the public one.

Now click “create” and create your very own free server!

It may be “Provisioning” for a couple of minutes, however once this finishes it’ll be fully online.

To use your new server, you’ll first need to access it via a technology named “Secure Shell” also known as SSH. Remember the SSH key?

I’ll explain how to do this in the next section. ->

Part 2 — SSH and server files

Now that your server is running, you’ll want to access it to get your Civ V Pitboss server running. As stated previously, you’ll access your server via a Secure Shell.

Linux and Mac users are able to use their terminal for this.

However Windows users will have to install an SSH client like PuTTY as this useful feature isn’t built into the operating system.

Putty can’t use normal SSH keys, it needs to use its own special .ppk file format, thankfully the installer for putty includes a software that can translate your SSH keys into .ppk keys. A tutorial explaining how to do this and more is outlined below:

So, to connect to your server you’ll need your Private Key that you generated and saved earlier, your server’s Public IP Address and a User Name. The IP Address and User Name can be found under “Instant Access” on your server’s dashboard:

Now that you’ve got all the details you need, open a terminal or your software of choice and type in a command similar to this:

ssh opc@132.145.50.239 -i ~/Documents/GameServer/ssh-key-2021-05-08.key
Replace the IP and Path with your own

Once you’ve written your command just click enter and it should look like this:

If it warns you about “Authenticity” don’t worry, you know this server is yours so it’s safe. Just type in “Yes” to this prompt.

If your terminal looks like mine, you’re literally in your server right now!

You’re ready to start setting up the server files for your Civ V Dedicated Pitboss server now.

We’re going to use a solution developed by a very clever person called “CraftedCard”. In their own words, this is (briefly) how their solution works:

So Civ 5 Server is a Windows-only GUI application, that needs to render frames with Direct3D (translated to OpenGL with wine)… This Docker setup creates a virtual X11 framebuffer for Civ to render to, provides a VNC server so you can remote in, installs Mesa such that the CPU can render frames (so no GPU needed), and libstrangle so that Civ only runs at 2 FPS, so rendering doesn’t consume the CPU so much (though it still takes an enormous amount of CPU time).

To download this to our server we’re going to “Clone” it using Git. First install Git using:

sudo yum install git -y

Once that is finished we can Clone the repository by first finding the “Clone with HTTPS” link located on the link above, then typing the command:

sudo git clone https://gitlab.com/CraftedCart/civ5_server_docker.git

Now if you type “ls” into the terminal you should see something like this:

If you don’t see this, try troubleshooting the previous step or two

Before we enter this folder and start setting up the Pitboss server, we fist need to install and run the Docker Engine. Type the following commands into the terminal one by one to install and run the Docker Engine:

sudo yum install -y yum-utils zip unzip
sudo yum-config-manager --enable ol7_optional_latest
sudo yum-config-manager --enable ol7_addons
sudo yum install -y oraclelinux-developer-release-el7
sudo yum-config-manager --enable ol7_developer
sudo yum install -y docker-engine
sudo systemctl enable docker.service
sudo systemctl start docker.service

If all went well, typing in the following command should result in an output that looks like this:

sudo docker run hello-world

Now that we’ve set up the Docker Engine I’d like you to enter that newly created folder and follow steps 1–3 on CraftedCart’s civ5_server_docker gitlab page (under the “How do you use it” header). To enter the new civ5_server_docker folder use this command:

cd civ5_server_docker/

Note 1: step 2 says it will take a while, it REALLY does so keep that in mind, expect it to take hours. Try running it overnight.

If you choose to upload your own Civ 5 files:

Step 1 uses the steam command line downloading service, that is why it requires your user-name and password, however if you’re uncomfortable giving away these details you can choose to upload your windows edition of Civ 5, CivilizationV_Server.exe and steam_appid.txt.

Files to upload:

  • For the Civ 5 upload you need to upload everything on your ..\Steam\steamapps\common\Sid Meier’s Civilization V\ local folder to your ../civ5_server_docker/civ5game/ remote folder.
  • For the CivilizationV_Server.exe and steam_appid.txt upload, you’ll need to download the Civ 5 SDK though steam then locate these files in the SDK’s local folder. After that, upload them both to your ../civ5_server_docker/civ5game/ remote folder.

How to upload: To upload these files, Linux and Mac users can simply use a technology called “Secure Copy”:

However, Windows users will have to download a software like WinSCP:

Once you’ve finished all 3 steps detailed in CraftedCart’s gitlab page it’s time to take a look at our dedicated Pitboss server! I’ll explain how to do that in the next section ->

Part 3 — SSH tunnel and VNC

Because of the way the dedicated Pitboss server works it’s currently inside of an X11 frame-buffer, thankfully CraftedCart has provided a Virtual Network Computing Server for us to connect to through a VNC viewer and an SSH tunnel. Don’t worry! It’s hassle free!

First let’s download a VNC viewer you can choose any you want however I recommend TigerVNC viewer for Linux and I’ve heard RealVNC viewer is good too and works with many operating systems.

Then let’s create an SSH tunnel so that we can connect to the VNC server using our VNC viewer. Open a new terminal or instance of your software before you do this. I’ll use an SSH command that looks like this:

ssh -i ~/Documents/GameServer/ssh-key-2021-05-08.key -L 5900:localhost:5900 opc@132.145.50.239

You should replace the path to your own path pointing to your private key, the user name (opc)(if needed) and the IP address to your Oracle Compute instance’s Public IPV4 address.

After this open your VNC viewer of choice (I’m using TigerVNC viewer) and direct the VNC server towards:

localhost:5900

You’re to connecting localhost here because you’ve already created an SSH tunnel to the server.

This is what my server looked like when I first connected to it:

While you’re waiting for the dedicated Civ V Pitboss server application to load you can minimize the steam box (keep it open however as the Pitboss server only functions when it’s open)

Almost done! Once the server is loaded, you can feel free to set up for game however you like.

Note: If it feels VERY slow, it’s not you, it’s intended to be like that. CraftedCart designed it to run a 2 FPS to keep it usable while taking up much less system resources than usual.

Now that your server exists let’s troubleshoot any network issues to ensure your friends can join!

I’ll explain in the next part ->

Part 4 — Firewalls and Port Forwarding

Before your friends can join, you’ll need to tell the network that, firstly, it’s ok for them to be joining (firewall) and you’ll need to tell the network where to direct your friends (port forwarding).

First let’s do the port forwarding, go back to Oracle’s cloud website and open your Compute Instance’s dashboard, there you will see a heading called “Primary VNIC”:

Click the subnet’s Hyperlink to go into the subnet’s dashboard.

Then look under the heading “Security Lists” and press the one currently existing security list there.

After that look under the header “Ingress Rules” and click “Add Ingress Rules”.

Note: I’ll be guiding you through what worked for me, however, some people have had much less luck than me and have needed to open up many more ports. If people can’t connect to your server try having a look at CraftedCart’s civ5_server_docker page. They have some information on there for the many ports you may have to open up/let through the firewall.

We’re going to Port forward the port 27016 as that’s the port the dedicated Pitboss server uses. We’ll let this same port through the firewall later. Add two ingress rules like the following:

Now that’s been completed, let’s let your friends through the firewall. If you’re still connected to your server through SSH (tunnel or not), great! If not, follow the steps in part 2 of this article to reconnect to your server.

Once you’re in, type in the following commands to open up the firewall to the port 27016:

sudo firewall-cmd --permanent --zone=public --add-port=27016/tcpsudo firewall-cmd --permanent --zone=public --add-port=27016/udpsudo firewall-cmd --reload

That’s it! Your free server is ready to use!! Give yourself a pat on a back-you’ve earned it. In the next part I’ll show you how to let your friends join and tell you some important information about your server ->

Part 5 — Friends and Things to Know

When you’ve set up your server how you’d like using your SSH tunnel and VNC viewer, press “Host game” and hand out the Public IP address of your compute instance to your friends (This is the same IP you’ve been using to SSH into your server). Don’t worry your friends can’t tamper with your server without the key!

Finally, your friends need to open Civ V -> multiplayer -> pitboss -> internet -> then type in the IP in the bottom middle of the screen and press enter on the keyboard.

Warning: It is likely your new cloud server may be dreadfully slow when you first create it, I found that my server sped up substantially after I left it idling for a night. Additionally, try to keep your Civ games to 6 people max and limit the amount of AI players there are.

Useful tips:

  • I had a problem starting the game when all people weren’t present for the first turn. Try to make sure everyone is present before the game starts.
  • This guide is for a Vanilla Civ V server, so ensure all clients connecting are also Vanilla! This should avoid any crazy bugs.
  • If you have a problem with people’s Cities randomly teleporting on turn 2, it’s because somebody still has a map mod installed.
  • It may take a while for your server to run at full speed.
  • If your friends find typing in the IP address tedious, tell them to use AutoHotKey.
  • Occasionally, log into your server via the VNC viewer and save the game. Backups are you best friend.
  • I haven’t figured out how email/steam turn notifications work, if you can make it work please tell me how!
  • You will immediately become the coolest person in your friendship group by showcasing this fancy new server technique.

I thank you very much for taking the time to read my article. If you made it this far- well done for making your free server!

I hope to see more people hosting servers like this in the Civ V community :)

--

--

Benjamin Jordanou-Bailey
Benjamin Jordanou-Bailey

Written by Benjamin Jordanou-Bailey

Undergraduate Computer Science student with a particular Interest in Artificial Intelligence.

Responses (3)