Copied to clipboard

Flag this post as spam?

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


  • jonok 297 posts 658 karma points
    Jul 12, 2021 @ 04:13
    jonok
    1

    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
    Jul 12, 2021 @ 06:29
    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 74 posts 193 karma points
    Jul 12, 2021 @ 20:17
    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 297 posts 658 karma points
    Jul 13, 2021 @ 01:43
    jonok
    1

    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 74 posts 193 karma points
    Jul 13, 2021 @ 14:12
    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 3074 posts 13632 karma points MVP 11x admin c-trib
    Jul 14, 2021 @ 09:29
    Jeavon Leopold
    105

    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 297 posts 658 karma points
    Jul 14, 2021 @ 23:43
    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 3074 posts 13632 karma points MVP 11x admin c-trib
    Jul 15, 2021 @ 08:31
    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 297 posts 658 karma points
    Jul 19, 2021 @ 06:49
    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 3074 posts 13632 karma points MVP 11x admin c-trib
    Jul 19, 2021 @ 09:13
    Jeavon Leopold
    0

    Great and well done!

  • jonok 297 posts 658 karma points
    Jul 28, 2021 @ 03:40
    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
    Jul 16, 2021 @ 06:54
    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 3074 posts 13632 karma points MVP 11x admin c-trib
    Jul 19, 2021 @ 09:12
    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

  • Michael Argentini 5 posts 78 karma points
    Aug 15, 2021 @ 00:36
    Michael Argentini
    0

    The dotnet publish route is the way to go. But I noticed that in the in the release candidate, the App_Plugins folder isn't included. So you'll likely have to modify your csproj file to include that in the publish output before copying the folder contents to your server.

  • Carlos Mosqueda 244 posts 435 karma points
    Jan 12, 2022 @ 18:59
    Carlos Mosqueda
    0

    Hi all, I know this thread is a few months old, but has anyone had issues when publishing using the dotnet commandline and the release publish command, the local DB or the .mdf file not porting over with the release?

    When I copied all of my files over to a server to run them on IIS, I get the 'install' steps, even though on my development machine I set up a local DB.

    I tried copying over the .mdf file over to the server file system to the /umbraco/Data/ folder and it seems the install still runs, not noticing the local DB.

    Any ideas or suggestions??

  • Scott Leslie 28 posts 143 karma points
    Mar 21, 2022 @ 10:50
    Scott Leslie
    0

    Did you get the local DB issue sorted ?

    I have same query

  • Bradley Petersen 3 posts 92 karma points
    Dec 18, 2022 @ 12:21
    Bradley Petersen
    0

    I'm experiencing the same issue, in visual studio it works perfectly, but when I publish it in iis, it's asking me to install umbraco.

    Please help.

Please Sign in or register to post replies

Write your reply to:

Draft