Skip to content

Instantly share code, notes, and snippets.

@bryanwieger
Last active July 20, 2024 21:17
Show Gist options
  • Save bryanwieger/eeba368453ffd6a67eb8aca43a696f2c to your computer and use it in GitHub Desktop.
Save bryanwieger/eeba368453ffd6a67eb8aca43a696f2c to your computer and use it in GitHub Desktop.
Setting up openra on aws ec2

To set up openra on AWS EC2

Disclaimer: This is not the best architected solution, so no guarantees on up-time

PreReqs:

  • Have an AWS account
  • Know basics of ssh and bash

Setting up the EC2 Server:

  1. Launch an EC2 with a Ubuntu OS. I used ami-059e7901352ebaef8 on a t2.micro
  2. Configure Security Groups for the EC2.
  • SSH port:22 will need be open to your IP
  • TCP port:1234 will need be open to all the IPs you want to be able to join you (I set mine to everyone)
  1. SSH into the ec2 instance. https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AccessingInstancesLinux.html
export PATH_TO_PEM=/path/to/pem/file
export EC2_PUBLIC_DNS=ec2-.public.dns
chmod 400 $PATH_TO_PEM
ssh -i $PATH_TO_PEM ubuntu@$EC2_PUBLIC_DNS
  1. Once in ssh, run this script :
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install libopenal1 mono-runtime mono-complete screen libasound2
curl -L https://github.com/OpenRA/OpenRA/releases/download/release-20231010/OpenRA-Red-Alert-x86_64.AppImage --output OpenRA-Red-Alert-x86_64.AppImage
chmod a+x OpenRA-Red-Alert-x86_64.AppImage
tmux
./OpenRA-Red-Alert-x86_64.AppImage --server Server.Name="MyServerName" Server.ListenPort=1234 Server.AdvertiseOnline=True Server.Password=MyPassword Server.EnableSingleplayer=true

Connecting to the AWS openra server

  1. Download & install the openra that is of the same version that you placed on the server. In this case release-20180307
  2. Find the IPv4 address of the ec2 running openra
  3. Open the multiplayer mode openra, under direct ip enter the ip address with the port number (1234)
  4. Enter credentials on next screen
  5. You should be connected to the server
  6. Happy gaming!

Notes

  • Port forwarding does not seem to work with this particular set up, so the game listing does not show up. However if you enter the ip address in the direct connet, you can connect.
  • If you end up having a long hang that ends up failing, double check the security group on the ec2. There needs to be an allow-rule for either your particalar ip, block of ip, or everyone.

Todo

  • Add notes on setting up Autoscaling group to ensure an ec2 is always up and running.
@phrohdoh
Copy link

phrohdoh commented Sep 8, 2019

@ssbljk2 maybe not these exact steps but the general idea will work on (almost) any public cloud provider.

@pastfama
Copy link

Docker image is outdated or is it the whole server?

@bryanwieger
Copy link
Author

@pastfama I just updated the docs with the latest image from https://github.com/OpenRA/OpenRA/releases/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment