'How to host an ASP.NET Core Blazor WebAssembly Hosted App on AWS?

What to do to safely host a Hosted Blazor WebAssembly App (Which has 3 projects i.e. Server, Client and Shared) (.NET Core 6.0) on AWS for someone who has never used AWS before? Which instance would be best? do I have to worry about the different projects or all I need to do is host the server app? and will the methods used for hosting static websites work for Blazor wasm hosted (I think they won't because I also need to host the server but I'm just making sure I understand everything)? Should I consider just getting a linux instance and hosting it there or there is an easier route?



Solution 1:[1]

Have you used Cloud before? If you are familiar with cloud, then you can use them. But if you are quite new in development, I believe you can just use shared hosting. My suggesstion, better go with Windows hosting to host your Blazor and .NET Core 6. But, it all depend on you, I'm more familiar with Windows, so I use Windows hosting. For hosting, if I can recommend, you can take a look at Asphostportal.

Solution 2:[2]

I'd suggest an EC2 instance of a windows server machine. The EC2 control panel should show you how to connect to the server with an RDP client. You will also need to configure the inbound rules in an AWS security group and apply it to your server. One of the rules should be RDP and set to you development machine's IP address. You might want to add an AWS elastic URL to your site too. Connect using the RDP client and create your site in IIS. Make sure you download and install the .Net core hosting bundle?

https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-aspnetcore-6.0.3-windows-hosting-bundle-installer

Then, in visual studio, right click the server project and select publish. You might find it easier the first time, if you publish the project to a local folder and copy all the published files to the website folder on your server.

Solution 3:[3]

You can of course use EC2.

There is also serverless solutions. Serverless mean you don't have to take care about the operating system, this mean you don't have to handle setup, updates, security...

For WASM project you can use S3. For the API you can use Lambda.

With these two solutions you don't have to handle the server and you pay only what you consume.

Search the internet for some video tutorials, now you have the keywords to find them.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Douglas Thomas
Solution 2 tellyman
Solution 3 Remi THOMAS