{"id":20484091,"url":"https://github.com/nuxy/aws-ec2-miscreated","last_synced_at":"2025-09-09T22:09:09.413Z","repository":{"id":142640274,"uuid":"534863292","full_name":"nuxy/aws-ec2-miscreated","owner":"nuxy","description":":cloud: Run a Miscreated game server in a AWS EC2 instance.","archived":false,"fork":false,"pushed_at":"2023-09-11T20:06:30.000Z","size":37,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-25T01:07:19.134Z","etag":null,"topics":["cryengine","docker","ec2-instance","game-server","hosting-aws"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/marcsbrooks/docker-miscreated-server","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nuxy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-10T01:59:58.000Z","updated_at":"2022-09-27T03:15:09.000Z","dependencies_parsed_at":"2025-01-16T04:25:37.778Z","dependency_job_id":"154a1f38-8a24-4966-b85a-326cd9d7f654","html_url":"https://github.com/nuxy/aws-ec2-miscreated","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/nuxy/aws-ec2-miscreated","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuxy%2Faws-ec2-miscreated","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuxy%2Faws-ec2-miscreated/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuxy%2Faws-ec2-miscreated/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuxy%2Faws-ec2-miscreated/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nuxy","download_url":"https://codeload.github.com/nuxy/aws-ec2-miscreated/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuxy%2Faws-ec2-miscreated/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274369475,"owners_count":25272610,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-09T02:00:10.223Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cryengine","docker","ec2-instance","game-server","hosting-aws"],"created_at":"2024-11-15T16:19:49.361Z","updated_at":"2025-09-09T22:09:09.377Z","avatar_url":"https://github.com/nuxy.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# aws-ec2-miscreated\n\nRun a [Miscreated](https://miscreatedgame.com) game server in a AWS [EC2](https://aws.amazon.com/ec2) instance.\n\n## Dependencies\n\n- [AWS CLI](https://aws.amazon.com/cli)\n\n### AWS requirements\n\nIn order to successfully deploy your application you must have [set-up your AWS Config](https://docs.aws.amazon.com/config/latest/developerguide/gs-cli.html) and have [created an IAM user](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users_create.html) with the following [policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_manage.html):\n\n- [IAMFullAccess](https://console.aws.amazon.com/iam/home#/policies/arn%3Aaws%3Aiam%3A%3Aaws%3Apolicy%2FIAMFullAccess)\n- [AmazonEC2FullAccess](https://console.aws.amazon.com/iam/home#/policies/arn%3Aaws%3Aiam%3A%3Aaws%3Apolicy%2FAmazonEC2FullAccess)\n\nWARNING: The policies above are provided to ensure a successful EC2 deployment.  It is recommended that you adjust these policies to meet the security requirements of your game server.  They should NOT be used in a Production environment.\n\n## Performance concerns\n\nA Miscreated server can currently use _up to 4GB of RAM_ when the game is fully loaded due to dynamic allocation of asset resources.  Furthermore, an _additional 30MB of RAM_ will be allocated for each concurrent player.  This should be considered when selecting the [AMI Instance Type](https://aws.amazon.com/ec2/instance-types) since resource usage determines cost.\n\n### Reducing operation costs\n\nIn order to meet the [game system requirements](#performance-concerns), while also being able to run a smaller EC2 instance type (currently `t3.small`), as part of the build process [I allocate 8GB of swap space](https://github.com/nuxy/aws-ec2-miscreated/blob/master/user-data.sh#L28) to the host OS.  Doing so allows me to reduce my hosting costs by 70%.. That said, I have created the chart below to be used as a guide in the EC2 instance selection process.\n\n| Total users | Instance type | Volume (size/type) |\n|-------------|---------------|--------------------|\n| 1  to 10    | `t3.small`    | 30 GB / [gp2](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-volume-types.html#vol-type-ssd) |\n| 11 to 50    | `t3.medium`   | 30 GB / gp2        |\n| \u003e 50        | `t3.large`    | 30 GB / gp2        |\n\n## Launching the EC2 instance\n\n    $ aws ec2 run-instances --image-id ami-05fa00d4c63e32376 --instance-type t3.small --region us-east-1a --block-device-mappings file://block-device-mapping.json --user-data file://user-data.sh --associate-public-ip-address\n\n## Logging into your server\n\nAs part of the installation process an [SSM Agent](https://docs.aws.amazon.com/systems-manager/latest/userguide/prereqs-ssm-agent.html) is added which allows you to access your server using the [Amazon EC2 Console](https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-sessions-start.html#start-ec2-console).  No SSH keys, port 22 routing necessary.\n\n### Accessing the container\n\n    $ docker exec -it \u003ccontainer-id\u003e /bin/bash\n\n## Game server defaults\n\nThe container comes with a vanilla installation of [Miscreated Dedicated Server](https://steamdb.info/app/302200) which is configured to support _up to 10 players_ and broadcasts the server name \"Miscreated\".  The server binds TCP/UDP ports 64090-64094 which needs to be opened using [EC2 Security Groups](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/working-with-security-groups.html#creating-security-group).  Furthermore, it also **exposes the RCON (remote control system) which is NOT password protected** and should either be disabled by removing the `+http_startserver` runtime option or restricted by setting `http_password` in your `hosting.cfg` file.\n\n### Miscreated (Patch 1.18.x, \u003e= v1.0.1.1126)\n\nDue to [recent changes](https://twitter.com/miscreatedgame/status/1615515730929410050) in the network stack the following items **must be addressed** prior to starting the server:\n\n1. You **must provide the external IP address** during runtime using `-sv_bind \u003cip-address\u003e` or the server will fail to initialize.\n2. You can no longer override `+sv_servername` in your `hosting.cfg` file since this will always use the runtime defined value.\n3. If you are using Steam UGC content **you must omit** `-sv_bind \u003cip-address\u003e` from runtime options.\n\nTo update these defaults you will need to [access the container](#accessing-the-container) and run the following command as root:\n\n    $ echo -e \"HEADLESS=yes\\nRUNCMD=\\\"Bin64_dedicated/MiscreatedServer.exe -sv_bind \u003cip-address\u003e +sv_maxplayers \u003cmax-players\u003e +sv_servername '\u003cserver-name\u003e' +http_startserver +http_password '\u003cpassword\u003e' +map islands\\\"\" \u003e /usr/games/.game-server\n\nOnce updated you just need to [restart the server](#managing-the-game-server) and you're good to go.\n\n## Managing the game server\n\nThe following command can be executed within the Docker container:\n\n    $ service game-server {start|stop|restart}\n\n## Overriding game sources\n\nIn cases where you have an existing game set-up (e.g. configuration, database, workshops) follow the steps below:\n\n### Copy the files to the container\n\n    $ docker cp hosting.cfg \u003ccontainer-id\u003e:/usr/games/Steam/steamapps/common/MiscreatedServer/hosting.cfg\n    $ docker cp miscreated.db \u003ccontainer-id\u003e:/usr/games/Steam/steamapps/common/MiscreatedServer/miscreated.db\n\n### Update the file permissions\n\n    $ docker -it \u003ccontainer-id\u003e /bin/chown games:games /usr/games/Steam/steamapps/common/MiscreatedServer/*\n    $ docker -it \u003ccontainer-id\u003e /bin/chmod 666 /usr/games/Steam/steamapps/common/MiscreatedServer/miscreated.dd\n\n### Restart the game server\n\n    $ docker -it \u003ccontainer-id\u003e /usr/sbin/service game-server restart\n\nMirroring that of the existing game directory, files that already exist will be overwritten.\n\n## Restart requirements\n\nSince the performance of the game engine degrades significantly as time goes by, the game server **forces a restart every 24 hours**.  However, due to a bug in the game engine this results with the server shutting down permanently.  In order to mitigate this a cronjob has been added to the host OS that restarts the server at 0:00 UTC.\n\nTo ensure both the host OS and game server are synchronized, you will need to define `schedule_shutdown_utc=0.0` in your _hosting.cfg_ or `+schedule_shutdown_utc 0.0` overriding the [game server defaults](#game-server-defaults).  Failure to do so will result in the server shutting down until the next scheduled restart.\n\n## Troubleshooting\n\nThe most common issue you will face is with **Steam UGC** availability.  For example, in the `server.log` below:\n\n```txt\n\u003c06:52:24\u003e [STEAM] UGC content: XXXXXXXXXX\n\u003c06:52:24\u003e [Game Version]: RELEASE DEDICATED SERVER\n\u003c06:52:25\u003e [STEAM] Download request made for content id: XXXXXXXXXX\n\u003c06:52:25\u003e [STEAM] Download failed for content id: XXXXXXXXXX, code: 15\n\u003c06:52:25\u003e [STEAM] This server will be forced to restart in 60 seconds.\n```\n\nThis is likely the result of **Steam Connection Managers** [degradation](https://steamstat.us).\n\n## References\n\n- [What is Amazon Linux 2023](https://docs.aws.amazon.com/linux/al2023/ug/what-is-amazon-linux.html)\n- [Miscreated game server list](https://servers.miscreatedgame.com)\n\n## Contributions\n\nIf you fix a bug, or have a code you want to contribute, please send a pull-request with your changes.\n\n## Versioning\n\nThis package is maintained under the [Semantic Versioning](https://semver.org) guidelines.\n\n## License and Warranty\n\nThis package is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose.\n\n_aws-ec2-miscreated_ is provided under the terms of the [MIT license](http://www.opensource.org/licenses/mit-license.php)\n\n[AWS](https://aws.amazon.com) is a registered trademark of Amazon Web Services, Inc.\n\n## Author\n\n[Marc S. Brooks](https://github.com/nuxy)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnuxy%2Faws-ec2-miscreated","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnuxy%2Faws-ec2-miscreated","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnuxy%2Faws-ec2-miscreated/lists"}