Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • jonok 265 posts 492 karma points
    20 days ago
    jonok
    0

    How to deploy local Umbraco 9 to a hosting VPS running IIS

    I still don't fully understand the ASP.NET Core environment, so please excuse if this is a dumb question, but I'm wondering how I would go about deploying a local Umbraco 9 website to a Windows VPS hosting server?

    With previous versions of Umbraco we would develop them locally and then just copy the files up to the VPS and set up the new site in IIS etc.

    Just wondering if there is an equivalent way to do this with Umbraco 9? As I am getting confused and can't seem to find the correct information, and I'm starting to plan a few upcoming projects in Umbraco 9. Or does the ASP.NET Core environment not allow for this sort of simple deploy? eg. do I have to do some command line stuff on the VPS to build, run and get the Kestral server running?

  • Padilla585 1 post 20 karma points
    20 days ago
    Padilla585
    0

    Umbraco will run on any standard IIS based hosting that supports .Net and SQL Server. If you're using a SQL CE database rather than full SQL Server (or MySQL), you'll need to make sure that your host supports that too.

  • Simon Justesen 58 posts 169 karma points
    19 days ago
    Simon Justesen
    0

    Well, Microsoft provides so many options this time, so its easy to get confused.

    To try to summarize the official docs (see below for links), every .NET Core app is now a self-contained deployment with all requirements and configurations included.

    Now you can choose to run your web app entirely WITHOUT IIS utilizing Kestrel/http.sys as the built-in web server, OR you can opt to have IIS (or any other web server like Apache or Nginx if you have a Linux server like me) act as a proxy in front of your .NET Core application(s).

    Instead of iIS being the center of attention, it is now acting as a form of "gatekeeper" forwarding requests to your .NET Core app (which could be Umbraco)..

    This might seem cumbersome compared to the old model, but makes perfect sense in a containerized world. It's a "new" approach to us .NET people, but the Java folks have been used to this approach for ages with Apache->Tomcat, I believe.

    Links:

    [1] https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/?view=aspnetcore-5.0

    https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/aspnet-core-module?view=aspnetcore-5.0

    https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/proxy-load-balancer?view=aspnetcore-5.0

    Bonus: Here is a slightly outdated example to spin up Docker containers running .NET Core and Microsoft SQL Server on Linux. I think it's pretty cool to see how efficiently things can be done. Must be fun to be a server admin these days: https://docs.docker.com/samples/aspnet-mssql-compose/

  • jonok 265 posts 492 karma points
    19 days ago
    jonok
    0

    Thanks for the reply Simon and I have installed the ASP.NET Core Module/Hosting Bundle and gone through those docs. However I'm still finding that I end up with a lot of browser tabs open, and a lot of information and testing, but not really any better understanding of how to get a local .NET Core app deployed to run on a hosting VPS.

    I understand the concept with IIS being the 'gatekeeper', and the site/app running in it's own container, but how do I go about moving my local site to the VPS and have it running there?

    So I'm now looking at throwing out Umbraco 9 and going with V8 just so that I can get these upcoming projects underway with the peace of mind that I'm not getting into a hosting situation beyond my skillset.

  • Simon Justesen 58 posts 169 karma points
    19 days ago
    Simon Justesen
    0

    Hi Jonok,

    Multiple options:

    Docker:
    https://docs.docker.com/develop/dev-best-practices/
    https://docs.docker.com/samples/dotnetcore/

    The traditional way:
    https://docs.microsoft.com/en-us/dotnet/core/deploying/#publish-framework-dependent

    As you control your own VPS you'd probably want the framework dependent cross-platform binary (the 'dotnet publish' default). It requires the .NET Runtime to be installed.

  • Jeavon Leopold 3016 posts 13253 karma points MVP 8x admin c-trib
    18 days ago
    Jeavon Leopold
    101

    You will need to install the "ASP.NET Core 5.0 Runtime - Windows Hosting Bundle Installer" https://dotnet.microsoft.com/download/dotnet/thank-you/runtime-aspnetcore-5.0.8-windows-hosting-bundle-installer

    Once you have that installed and have restarted IIS (net stop was /y followed by net start w3svc), create a site in IIS as you would for a v8 site, however you need to ensure that ".NET CLR version" is set to "No Managed Code" for the Application Pool.

    For getting started either use the Publish Wizard in Visual Studio set to "Folder" or "dotnet publish" to generate your project output. These files need to be uploaded to the IIS site. You will see all the dlls in the root and a crucial web.config file.

    The output files should look something like this

    enter image description here

    Details on all the various options can be found at https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/?view=aspnetcore-5.0

  • jonok 265 posts 492 karma points
    17 days ago
    jonok
    0

    Thanks Jeavon, this is looking good. Just another question - in Visual Studio, when I open the U9 website as a folder, it doesn't give me the 'publish' option in the build menu. What's the best way to get the Umbraco 9 app to open as a Visual Studio solution that I can publish? I figure I could create an empty solution in VS and then copy the U9 files in, but I'm not sure of which option to use when creating a new VS solution/project.

  • Jeavon Leopold 3016 posts 13253 karma points MVP 8x admin c-trib
    17 days ago
    Jeavon Leopold
    0

    Did you use the template to create the project? I should have made a csproj file, you should open this in Visual Studio

  • jonok 265 posts 492 karma points
    1 week ago
    jonok
    1

    Thanks Jeavon - I was getting mixed up with solution and project files in VS, and went back to the start again with the template and then created the correct project file. I have published and now have the site running locally in IIS. Thanks very much for your help, you too Simon.

  • Jeavon Leopold 3016 posts 13253 karma points MVP 8x admin c-trib
    1 week ago
    Jeavon Leopold
    0

    Great and well done!

  • jonok 265 posts 492 karma points
    4 days ago
    jonok
    0

    Jeavon - one more question... if I want to update the app settings JSON, do I need to do this before publishing the project? Or should I just be able to modify the appsettings-schema.json file once the site files have been deployed to my hosting server? The changes that I am making don't seem to be taking effect.

  • Edwin Shaver 1 post 20 karma points
    16 days ago
    Edwin Shaver
    0

    With previous versions of Umbraco we would develop them locally and then just copy the files up to the VPS and set up the new site in IIS etc.

  • Jeavon Leopold 3016 posts 13253 karma points MVP 8x admin c-trib
    1 week ago
    Jeavon Leopold
    0

    v9/.NET5 is a bit different, you need to use dotnet publish or the publish wizard in Visual Studio to get the output files you can then copy to your VPS

Please Sign in or register to post replies

Write your reply to:

Draft