MineCloud
An AWS CDK project to set up a low-cost on-demand multiplayer server (Minecraft, Terraria, and more...) for a Discord community in just a few minutes
Install / Use
/learn @VeriorPies/MineCloudREADME
MineCloud
MineCloud is an on-demand multiplayer server hosting solution based on AWS CDK (Cloud Development Kit) that allows users to set up an almost free on-demand game server for a Discord community in just a few minutes.
MineCloud supports the following games out of the box:
Don’t see your favorite games? Consider contributing to the list by following the Create and publish your own MineCloud Configuration Packages guides!
<br>
Features
- Discord Bot - start, stop, and backup the server with Discord commands (The server IP address will be sent to the Discord channel after start)
- Auto shutdown and backup when no one is online
- Support varieties of games out of the box
- Easy to setup - we do our best to make the process as simple as possible :)
- Almost free (≈60 cents for 20 hr play/month - <ins>with a 2 CPUs & 8GB RAM server</ins>)
- Fully customizable - install whatever mods you like
- No maintenance cost - don't have time to play? Just leave it there! It cost almost nothing
- Able to support new games by creating and publishing Configuration Packages
Supported Discord Commands
mc_start: Start the server and send the IP address to the Discord channelmc_stop: Stop the servermc_restart: Restart the server processmc_backup: Pause the server and create a backupmc_backup_download: Get the download link of the latest backup
Cost Breakdown
with 20 hrs play / month
- Lambda: Free tier
- S3: 5GB free tier for first 12 months, $0.03/GB after that (default max backup count is 3)
- Data Transfer: Free tier, unless total data transfer exceeds 100GB
- EC2: 0.035 (
t2.largespot price) * 20 (hr) ≈ $0.7/month - Total: ≈ $0.7/month
Please refer to Spot Instances Pricing and S3 Pricing for more information.
Diagram
For more details, please check out the wiki page.
Discord Server
Interested in MineCloud? Join our Discord Server!
How To Setup?
If you prefer, we have a step-by-step video tutorial ↓

Prerequisites
- A Discord account :)
- Node.js 18 (or above) - If haven't, go to https://nodejs.org to download and install the latest version
- Type
node --versionin the terminal to confirm Node is properly set up. You should see something like this:v18.xx.x
- Type
- An AWS account and AWS CLI
- If haven't already, go to https://aws.amazon.com/ to register an AWS account
- Download and install AWS CLI from here
- Type
aws --versionin the terminal to confirm AWS CLI is properly set up. Something like this should show up:aws-cli/2.10.0 Python/3.11.2 Windows/10 exe/AMD64 prompt/off
- Type
- Setup AWS CLI credentials:
- Login to your AWS account, click the account name at the top-right corner and click "Security credentials". Go to the "Access keys" section and create an access key. Notes down
Access keyandSecret access key
<img width="80%" src="images/get-aws-access-key.png" >
- Login to your AWS account, click the account name at the top-right corner and click "Security credentials". Go to the "Access keys" section and create an access key. Notes down
- In the terminal, type:
When prompted, enter theaws configureAccess keyandSecret access keyyou got from the last step (and optionally choose the "default AWS region" and "output format") - Once done, type
aws sts get-caller-identityin the terminal to confirm the AWS CLI credentials are set up correctly. Something like this should show up:{ "UserId": "1234567890", "Account": "1234567890", "Arn": "arn:aws:iam::1234567890:xxx" } - Prerequisites done, now start the fun part :)
Set up MineCloud
- Pick a Configuration Package from your desired game. Next to the package you will see the corresponding MineCloud version (e.g.
MineCloud x.x.x), download the corresponding version from the MineCloud release page and unzip it. - Open terminal in the MineCloud project directory:
- Install Node dependencies:
npm install - Copy and paste the downloaded Configuration Package (e.g.
"1.19.4 Vanilla.zip") into the/minecloud_configsfolder. - Install Configuration Package:
npm run install-minecloud-config-pack- The following message should be printed:
Successfully installed <Configuration Package Name> configuration package.
- The following message should be printed:
- Install Node dependencies:
- Copy
MineCloud-Service-Info.ts.sampletoMineCloud-Service-Info.tsand fill in the following fields:AWS_ACCOUNT_ID: Click the account name at the top-right corner of your AWS console and copy theAccount IDAWS_REGION: Pick a region that's closet to you. Some example values are:us-west-2,ap-northeast-1oreu-west-2DISCORD_APP_IDandDISCORD_PUBLIC_KEY: Go to Discord Developer Portal and click "New Application" to create a new Discord APP. On the "General Information" page, you will find the App Id and Public Key.
<img width="80%" src="images/discord-app-id-and-public-key.png" >DISCORD_BOT_TOKEN: Go to the "Bot" tab, reset and copy the token- This is the Discord BOT that will handle our commands. If there's no BOT shown, click the "Add Bot" button to create a one
<img width="80%" src="images/discord-bot-token.png" >
- This is the Discord BOT that will handle our commands. If there's no BOT shown, click the "Add Bot" button to create a one
DISCORD_CHANNEL_WEB_HOOK:- Open regular Discord, go to the Discord server you want to add MineCloud to, choose a text channel, and click "Edit Channel".
- Go to "Integrations" => "Webhooks", click "New Webhook" to create a new Webhook then copy it.
- This text channel is where our VM server instance will send updates to <img width="80%" src="images/discord-channel-webhook.png" >
- (Optional) Create and update a DNS record upon boot:
- Users of the server can connect to the same DNS name instead of having to update the server configuration each time a new IP gets assigned.
- The CDK infrastructure automation script will create a DNS record under a given Hosted zone.
- The start_server.sh script will update the DNS record every time the VM starts.
- NOTE: The script will not create a Hosted Zone for you! The domain purchasing needs to be done manually and the Hosted Zone must be available in the same AWS account where you want to setup MineCloud.
- ATTENTION: For the instance to update its own DNS record the permissions must be broader than without using a DNS name. This could be used by an attacker to takeover the DNS record.
DOMAIN_NAME: contains the domain name of an existing hosted zone.- It seems that the ARecord does not get deleted when the start_service.sh script updated the IP address externally. Currently you need to delete the ARecord manually if you want to re-run cdk deploy after destroying everything.
- Deploy MineCloud
- (Optional) Customize Deployment
- Common customizable options (e.g. VM type, disk size...etc) can be found in
minecloud_configs\MineCloud-Configs.ts - Follow the "Custom deployment" section on the Configuration Package's home page for games-specific customizations
- Common customizable options (e.g. VM type, disk size...etc) can be found in
- Open the terminal in the MineCloud folder and enter
npx cdk listto make sure the build pass. You should see the stack name being printed:<Stack Name> - Bootstrap your AWS account by running
npx cdk bootstrap aws://<AWS_ACCOUNT_ID>/<AWS_REGION> - Before deploying, read through the End User License Agreement for the game (ex: Minecraft EULA, Factorio EULA)
- Enter
npx cdk deployto deploy the stack. - Sit back and relax, this will take like 5~10 minutes ☕.
- When you see a "The server instance is ready" message shown up in the Discord channel, this means your game server is almost ready to connect :)
- (Optional) Customize Deployment
- Setup BOT for your Discord server
- After MineCloud is deployed, go to your AWS [CloudFormation page](https://console.aws.amazon.com/clo
