Skip to content

Getting Started

Aaron Lucia edited this page Aug 26, 2020 · 1 revision

Your guide to deploying your first Minecraft server with the AWS CDK!

Tip: The cdk commands in this guide can be prefixed with npx like npx cdk to run the cli without needing to install it globally!

Step 1

Create a new AWS CDK project. The AWS CDK supports many languages, so feel free to choose the one that is most comfortable for you to work with. This guide will work with typescript.

cdk init --language typescript

You can checkout the AWS 'Your first AWS CDK app' documentation for more details on creating a new project.

Step 2

Once we initialize a new app, we need to install the @engineal/aws-cdk-minecraft package by running:

npm install @engineal/aws-cdk-minecraft

Step 3

The new AWS CDK project will have created a new empty stack for you to work with. In this stack, we will define our new world! To deploy a new vanilla Java Minecraft server with default settings, including automatic backups, cost savings, and more, we can initialize a new JavaWorld object.

Tip: If you want to create a Bedrock server (if you are playing on mobile, console, or other platforms), replace JavaWorld with BedrockWorld.

import {Construct, Stack, StackProps} from '@aws-cdk/core';
import {JavaWorld} from '@engineal/aws-cdk-minecraft';

export class HelloCdkStack extends Stack {
  constructor(scope: Construct, id: string, props?: StackProps) {
    super(scope, id, props);

    new JavaWorld(this, 'MyFirstMinecraftWorld');
  }
}

Step 4

Now we can deploy the stack! Run cdk deploy to deploy your new Minecraft world!

Step 5

Play!

Clone this wiki locally