I’ve been learning C# with .NET Core and would like to start hosting my projects online, everything I’ve done is locally so far.

I don’t THINK I need a Windows Server host, they seem to be expensive, I think .NET runs ok on a Linux server? But when searching for a .NET hosting provider I see windows everywhere.

I’m hoping to find as low a cost option as possible. It will be mostly for hosting projects to show potential employers / clients etc.

where do you generally host your .NET projects? I’ve seen AWS / Azure / Linode recommended, but I think costs can spiral quickly?

  • brandon@lemmy.ml
    link
    fedilink
    English
    arrow-up
    10
    ·
    edit-2
    1 year ago

    .NET core is supported on Linux. There is some stuff that won’t work on Linux, like WPF, but it doesn’t sound like you’re using that.

    If you are searching specifically for “.NET hosting” you are bound to come across a bunch of Windows results, so I wouldn’t recommend that.

    Any Linux virtual server provider will work just fine, provided they support a Linux distribution that runs the .NET core runtime, (which includes all the major ones). I’d avoid AWS or Azure. Those are a good way to run up a big bill pretty quick, and their service offerings are quite complicated.

    A $5 vm from the likes of Linode, Digital Ocean, Vultr, etc, will get you started just fine. Typically the costs won’t be able to “spiral out of control”–you’ll be allocated a set amount of CPU, memory, disk, and network usage.

    You will have to configure the web server & .net yourself.

    I am assuming from your post that you don’t have a lot of experience with Linux. You can try setting it all up from home too if you have an old PC or laptop lying around (either for practice, or to self-host long term). Download a linux distribution and give setting up a server a shot.

  • variouslegumes@reddthat.com
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 year ago

    Depends if you want a managed service or not. As stated by others, any Linux vm can do it: Aws ec2, Azure, Digital ocean, etc. Cost won’t spiral because you pay a fixed fee for the vm you choose (can be like 5 dollars a month).

    The options that can spiral if for some reason your app started being used a lot. But likely these will be pretty much free:

    A lot of cloud platforms have some sort of managed container service. Wrap your app in a docker container and pay per 10K API calls for example.

    Another option is to use a managed service that handles the runtime for you (AWS Lambda, Google cloud app engine, etc.) These options should have the option for a dotnet core runtime. They can also be really cheap if your app isn’t used much.

  • towerful@beehaw.org
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    Having never built an app in .net, my first instinct would be to try to containerise it.
    This would make the installation of it (mostly) platform independent, and would let you easily prove it on your development machine.

    https://learn.microsoft.com/en-us/dotnet/core/docker/build-container?tabs=windows

    Note that docker isn’t the only way. There is also podman, and I’m sure there are others.
    All of these build ontop of the Open Container Initiative, and are mostly interchangeable. It’s only once you dig deeper into docker/podman/whatever that you might start running into compatibility issues.
    I don’t think I’ve ran into any issues between using docker and podman, albeit for nodejs applications.