This guide installs Umbraco on Linux with .NET, Nginx reverse proxy, and a systemd service.
It supports Debian 10 to latest stable, Ubuntu LTS, and RHEL 9+ compatible systems.
- name: Install Umbraco
hosts: umbraco
become: true
vars:
umbraco_user: umbraco
umbraco_group: umbraco
umbraco_home: /opt/umbraco
umbraco_port: 5000
tasks:
- name: Install dependencies on Debian/Ubuntu
apt:
name:
- dotnet-sdk-8.0
- aspnetcore-runtime-8.0
- nginx
- curl
- git
state: present
update_cache: true
when: ansible_os_family == "Debian"
- name: Install dependencies on RHEL family
dnf:
name:
- dotnet-sdk-8.0
- aspnetcore-runtime-8.0
- nginx
- curl
- git
state: present
when: ansible_os_family == "RedHat"
- name: Create Umbraco group
group:
name: "{{ umbraco_group }}"
state: present
- name: Create Umbraco user
user:
name: "{{ umbraco_user }}"
group: "{{ umbraco_group }}"
home: "{{ umbraco_home }}"
shell: /usr/sbin/nologin
create_home: true
- name: Create Umbraco app with dotnet template
command: dotnet new umbraco --output {{ umbraco_home }}
args:
creates: "{{ umbraco_home }}/UmbracoProject.csproj"
- name: Publish Umbraco app
command: dotnet publish -c Release -o {{ umbraco_home }}/publish
args:
chdir: "{{ umbraco_home }}"
- name: Create systemd service
copy:
dest: /etc/systemd/system/umbraco.service
mode: "0644"
content: |
[Unit]
Description=Umbraco CMS
After=network.target
[Service]
User={{ umbraco_user }}
Group={{ umbraco_group }}
WorkingDirectory={{ umbraco_home }}/publish
Environment=ASPNETCORE_URLS=http://127.0.0.1:{{ umbraco_port }}
ExecStart=/usr/bin/dotnet {{ umbraco_home }}/publish/UmbracoProject.dll
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target
- name: Reload systemd
systemd:
daemon_reload: true
- name: Enable and start Umbraco service
service:
name: umbraco
state: started
enabled: true
dotnet packages.Beyond this playbook, we offer:
Contact our automation team: office@linux-server-admin.com