Edgegap’s Dedicated Game Server Hosting – Plugin Guide
Mirror's unofficial Edgegap Hosting Plugin documentation.
Edgegap helps you build and launch a dedicated game server in the cloud directly from Unity’s editor, without almost any coding or Linux/Cloud usage whatsoever. Which helps make game server hosting easy!
Thanks to Edgegap’s dedicated game server hosting plugin for Unity, Mirror users get 1.5 vCPU of cloud hosting for free with Edgegap’s free trial!
Overview
Integration of Edgegap is simple and takes a few minutes with 3 basics steps:
Installing Unity dependencies & Docker
Installing the Unity plugin & creating a free account onEdgegap
Configuring, building & pushing the server to Edgegap
Edgegap’s plugin walks you, step-by-step, making it the easiest way to add dedicated game server in Unity.

Setting Up your Project
If you are installing a new project, rather than installing the latest version, we strongly recommend using the “LTS” (Long Term Service) version of Unity for your project, i.e., Unity 6.0 (6000.0.60f1) as of writing. This ensures compatibility with tools & services, and long-term support of Unity’s version for your projects.
1. Installing Linux Build Support
From yourUnity Hub, selectInstalls, select theManage icon next to the Unity version you intend to use in your project and clickAdd Modules:

Make sure to install all three of Unity’s Linux Build Support Modules. Namely:
Linux Build Support (IL2CPP), Linux Build Support (Mono), Linux Dedicated Server Build Support,
Additionally, depending on your target platform OS, you will need to add:
Windows: Windows Build Support (Mono)
Mac: Mac Dedicated Build Support (IL2CPP) and Mac Dedicated Server Build Support
WebGL: Web Build Support

For users with new projects, which modules to add will be prompted when selecting which version to install. Make sure to add it there. However, you can return at any time to add them as shown above.
2. Installing Docker
Edgegap uses containers, which is a virtualization that ensures to can run on any hardware, anywhere in the world.
Any containerization tool should work, but the easiest is to use Docker Desktop:
https://www.docker.com/products/docker-desktop/
Simply download it, install it, restart the dev machine, then open it (if it doesn’t open automatically at boot time. Then run it in the background.
Installing the Unity plugin
From the top navigation menu in Unity, selectWindow, thenPackage Manager.

Within the Package Manager, click on the "+" icon, then selectAdd Project from Git.

Paste Edgegap's Unity plugin URL:
<https://github.com/edgegap/edgegap-unity-plugin.git#partner/mirror-source>

SelectInstall.
That’s it!
From the top navigation bar, selectTools and then open the plugin by clicking onEdgegap Server Hosting.

The plugin automatically opens up. SelectSign in with Edgegap to start the process of creating an account (or sign-in to sync with the platform, for users with active accounts).

Create a Free Account on Edgegap
Signing up to Edgegap is easy and free. Use your ownGoogle orGitHub account, or sign-up with anemail.

You are now asked to nameYour Organization.

Automatically, theOneClick Token Create Successfully screen appears. This is your token (blurred here). Simply copy it by clicking on the clipboard icon.
Do not share your token with anyone or on public channels like Discord, as they could deploy game servers on your behalf!

Configuring, building & pushing the server to Edgegap
1. Validate your Token
Return to Unity and paste the token in the field under1. Connect your Edgegap Account. Then, selectValidate Token.

2. Building your Game Server
After verifying successfully, you optionally can make sure that you have the Linux Server dependencies by clicking onInstall.
Then, selectEdit Settings to make sure the game scenes you want to include are included.

UnderLinux Server, make sure the scenes are listed. If not, selectOpen Scene List and add them manually.

Additionally, doublecheck that your build set up. Specifically, selectNetwork Manager from your project’s hierarchy, and the underNetwork Manager, ensure
UnderConfiguration, thatDon’t Destroy on Load is selected (i.e., the ✔)
Headless Start Mode is set toAuto Start Server


Return to the plugin and selectBuild Server to start the build process. You should see “Build succeeded” in green when complete.
3. Containerize your Game Server
First, make sure Docker is running by selectingValidate. You should see “Docker is running” in green.
While you may want to change the image name, build path, and tags in the future, we recommend skipping this entirely and selectContainerize with Docker button to start the containerization process.

After a short wait, you should see “Containerization succeeded” in green.
4. (Optional) Test your Server Locally
Optionally, you can test your container locally by selectingDeploy Local Container. You may configure the server image tag, and Docker run parameters, but we recommend skipping this initially.
If it succeeds, you should see “Container deployed successfully” in green.

The container should be visible within the “Container” tab in Docker Desktop.
5. Upload to Edgegap
Now we’ll upload the game server to Edgegap’s registry so they can deploy it to their cloud network.
Application name, server image name and server image tag are all pre-filled. While all can be edited, we suggest to keep things as-is for now.
SelectUpload Image and Create App Version button, which automatically uploads the build to Edgegap’s platform.
Older images on your dev machine can be uploaded. Find the docker image name and tag in Docker Desktop under images tab.

After a bit of loading, a new web browser will open. This is your application’sVersion parameters. You can customize the version’s name, resources parameters, and more.
For now, click onSubmit to create your version.

Resources optimization is key to limit overall cloud usage. Edgegap offers vCPU fractioning, which means you can reduce your game server down to ¼ of a vCPU. When ready, make sure to check out Edgegap’sanalytics and recommendedserver builds optimization strategy
Then, theCreate Portscreen appears. Here you can change theport, and theprotocol type. If you use KCPTransport the default port of 7777 and UDP.
If you are working on a WebGL project, then use 7778 and WS protocol. For other transports, select the corresponding protocol an port configured in Network Manager in your server build.
SelectSubmit to create your deployment.

6. Deploy to Cloud
The final step is to select which version to deploy to Edgegap’s cloud network. Here, your latest application will be preset but can be changed. You must manually selectApplication Version by simply clicking on the drop down (the ▼ on the right) and the latest versions will be shown, here in the image highlighted in green:

Once selected, simply selectDeploy to Cloud.
This automatically opens your deployments’ page on the Edgegap’s platform. After a few seconds, the deployment will change from “deploying” to “ready”.

Once that’s done, click on the deployment. This opens up theDeployment Details page. Scroll down and make sure to note theHost URL alongside theExternal Port.
Copy the Host URL using the clipboard.

While internal ports for the server process are defined as part of app version, external ports are assigned at random once a deployment is created, so that a potential malicious party (hacker) is slowed down and detected before they can cause damage.
Back in Unity, select theNetwork Manager from your project’s hierarchy.

Within theInspect Tab, make sure to set:
Paste theHost’s URL from the deployment to theNetwork Address
Replace the defaultPort (usually 7777) to theExternal Port from the deployment

Then launch the scene in Unity Editor, and test the project:

It's important to understand the magic that is happening here.
Not only can you launch a game server with Two Clicks now.
You can even launch thousands of servers with another click on Edgegap's website! 🤩
To reduce costs (if you are paying), you can pressStop Last Deployment in the plugin once you are done.

Troubleshooting Connection Issues
If your Server Status saysReady but you can't seem to connect, try this:
On the Edgegap website, go to Deployments -> select your Deployment -> selectContainer Logs, check the log files to see if your game server launched or if there are issues.
If it says "exec user process caused: no such file or directory": this can happen if you pushed an ARM build to Edgegap's x86 infrastructure. We already updated the plugin to properly cross compile from ARM so this generally should not happen anymore.
If everything seems fine but you still can't connect, please talk to an Edgegap employee in the Mirror Discord's#edgegap channel.
Last updated