Skip to main content

Deploying on Hathora Cloud

This guide is intended to walk you through how to deploy a game on Hathora Cloud, dynamically provision compute for a room, and connect to it -- all in under 15 minutes.

Hathora services are available to use via two interfaces: web Console UI and command line interface (CLI). Both offer core functionality, so pick whichever you prefer.

Access Hathora's developer dashboard here. Hathora Console Dashboard

Make an account

Create an account using Google sign in or provide an email and password.

Create or login to Hathora. Hathora Console Dashboard

Create an application

Once you're logged in, you are ready to create your first application.

Select the Create Application button and provide a name. Select Create to register your application. Hathora Console Dashboard

note

No two applications in your account can have the same name. An application name may only contain:

  • numbers
  • lowercase letters
  • dashes
  • maximum of 32 characters

Deploy a server build

Provide the server build for your application with a Dockerfile in the root folder.

tip

If you need help writing a Dockerfile for your project message us on Discord and we'll help you write one!

tip

It can take several minutes to build a Docker image and push it to our global container registries.

To create a deployment here are the required fields:

  • appId: returned from create application
  • file: path to the tgz archive to deploy
  • roomsPerProcess: number
  • planName: "tiny", "small", "medium", "large"
  • transportType: "tcp", "tls", or "udp"
  • containerPort: number
note

If you don't have your own project, download this .tgz file that we pulled from a public Minecraft repository. The rest of this guide will use the Minecraft example.

Click to upload or drag and drop a server build into Upload server build. Next, click Build Application to start building your docker image. You can track the build logs below.

note

For Minecraft, upload the docker-minecraft-server.tar.gz file.

Hathora Console Dashboard

Select Instance profile and Number of rooms per process based on your server's needs

note

For Minecraft, set Instance profile to 2 cores/4 GB and Number of rooms per process to 1.

Hathora Console Dashboard

Provide Hathora with configurations for your server such as Container port, Transport type, and Environment variables.

note

Minecraft uses the following configurations:

  • Container port as 25565
  • Transport type as TCP
  • A single Environment variable as Key = EULA and Value = TRUE

Hathora Console Dashboard

Create a room

After successfully deploying your server build, create a room to provision your first game server instance.

tip

Normally a lobby or matchmaker service will be used to programatically call createRoom. However, for testing, you can call it manually through the Console UI/CLI.

To create a room, you must specify which region it'll be created in.

Click the create room dropdown and select the region to create the room in. A room will spin up and appear in the Active Processes table in less than 30 seconds.

Hathora Console Dashboard

Connect your client

In order to connect to a specific room, you will need to look up its connection details and get the host and port where it's reachable.

From the Active Processes table, click on the Details button to navigate to the Process details page. Here you can copy the Connection Information.

Hathora Console Dashboard