Unity WebGL Deployment

So you’ve built a webgl game and you want to share it…  It’s time to find some unity webgl hosting..  Deploying a webgl game to dropbox or google drive used to be easy simple options, but if you’ve done some research, you’ll see that they’re dead.  Luckily, there’s still a great, easy, and FREE way to host your webgl deployment.

Introducing Azure for Unity WebGL Hosting

Setting up this deployment can be done in under 10 minutes (even faster if you already have an azure account setup).  Once it’s setup, deployment is as simple as an FTP copy (drag / drop the folder over).

Creating the account

If you don’t already have an azure account, create one here: https://azure.microsoft.com/en-us/free/

Once your account is ready, sign into the dashboard.

Creating the website

Click on New

Select Web App from the list

 

Give your site a name

Choose a resource group (or create one by typing in a new name)

Keeping it free

Unless you’re ready to pay for the hosting (and have a need for it), you’ll want to set your service plan to free.

Click on the App Service plan link from the overview window

Select “Scale Up”

Choose the “Free” tier and click select.

Setting up FTP Credentials

Once you’ve created the website (it’ll take a few minutes to be ‘ready’), you’ll need to setup the FTP deployment credentials.

Select “Deployment Credentials”

Choose a username and a password.

Click Save

FTP Setup

If you have an FTP client you already use and like, go ahead and stick with that.

If not, I’d recommend FileZilla – https://filezilla-project.org/

With whatever FTP program you use, you’ll need the FTP Hostname and deployment name.

You can see these on the overview page.

Notice that the username is prefixed with the website name and a backlash.  Mine is “webgldemo2\webgldemodeployer”

 

Enter your FTP credentials and connect.

Uploading the FTP

Upload all the files into the wwwroot directory.

Just drag them over (if you’re using something like filezilla).

IMPORTANT – Adding the config

You may have noticed there’s a web.config file in that folder.

Without that file, your game won’t load correctly.

To make it simple, you can download that web.config file here: https://unity3dcollege.blob.core.windows.net/site/Downloads/web.config

 

Conclusion

That’s all there is to it, now that you’ve deployed your game, you can play it by loading the webpage.

To find your web address just take another look at the overview page.