Categories
Self-Hosted

How to Install Heimdall Dashboard on Ubuntu 20.04

Here you will learn how to install Heimdall Dashboard on Ubuntu 20.04. Specifically, you will learn how to download the latest Heimdall Dashboard source from GitHub, install the PHP dependencies of Heimdall and install a systemd service to auto start Heimdall dashboard.

Heimdall Dashboard

Heimdall is a great dashboard web application. It allows you to organize and monitor your self-hosted applications, such as plex, emby, sonarr, radarr. You can even add any web URL yourself. With Heimdall, you don’t have look for something in the long list of a bookmark folder from your browsers like Google Chrome or Firefox.

The official way to install Heimdall on Ubuntu 20.04 is through Docker, but if you have installed any web application yourself, it is actually quite easy to install without Docker, which saves some space and CPU/memory resources if you are using a Raspberry Pi.

However, it is not clear how to install it on Ubuntu such as 20.04 without Dock on its GitHub repository. How can I install Heimdall dashboard without Docker? Here we will show you how to install Heimdall on Ubuntu 20.04.

Prerequisite

You should have a Linux OS such as Debian-based Ubuntu 18.04, 16.04 or 14.04, Debian 10, 9 or Raspbian 10, 9. Other Linux distribution may also work but needs adaptation.

Step 1 — Download Heimdall from GitHub

First, we will install Heimdall dashboard from its GitHub repo. Run the following command to download the latest release, which will use GitHub’s API and use awk to get the latest version string.

RELEASE=$(curl -sX GET "https://api.github.com/repos/linuxserver/Heimdall/releases/latest" | awk '/tag_name/{print $4;exit}' FS='[""]'); echo $RELEASE &&\
curl --silent -o ${RELEASE}.tar.gz -L "https://github.com/linuxserver/Heimdall/archive/${RELEASE}.tar.gz"
Screenshot from 2020 05 04 02 32 28

After it’s done, we run ls *.tar.gz to verify. Here we see the file we just downloaded 2.2.2.tar.gz. As new releases come out, the version number will differ. Just remember to change the version string in the following steps.

Alternatively, you can go to the releases page and download the latest to your home folder, which is 2.2.1 at the time of writing. Name the file to VERSION.tar.gz as we will use this file in the remainder of this how-to.

the releases page of Heimdall's GitHub repo

To uncompress the tar.gz file, run

tar xvzf 2.2.2.tar.gz

Use ls *2.2.2/ to verify. You will see output like the following:

Screenshot from 2020 05 04 02 34 47

Step 2 — Install PHP modules on Ubuntu 20.04

Next, because Heimdall is written in PHP and more specifically, the Laravel PHP web framework, we will need to install 2 PHP module dependencies php-sqlite3 and php-zip on Ubuntu 20.04 in order to install Heimdall:

sudo apt install php-sqlite3 php-zip
We are installing PHP modules (sql ite and zip) on Ubuntu 20.04

Do you know?

If you don’t what dependencies a PHP application needs, you can run php artisan serve and it will suggest what dependencies are missing.

Step 3 — Run Heimdall Dashboard with php artisan serve

Now change to the directory by cd Heimdall*/, which is your Heimdall installation, and try to start serving it with php artisan serve, which is indeed the way to start any Laravel application. You might see the following error because it’s not yet compatible with PHP 7.4 on Ubuntu 20.04. But in the future, this should be fixed.

In ArrayInput.php line 135:
Trying to access array offset on value of type int

To fix it, edit the ArrayInput.php at line 135 with vim ./vendor/symfony/console/Input/ArrayInput.php +135 and comment on the elseif line and what’s inside. The following screenshot shows the 2 lines.

Fix the Haimdall run error "Trying to access array offset on value of type int" for PHP 7.4 on Ubuntu 20.04

Now run php artisan serve twice (at least for me) to see Laravel development server has started.

Screenshot from 2020 05 03 22 52 15

Right-click “http://127.0.0.1:8000/” and open it, you should see Heimdall dashboard running on your Ubuntu 20.04 OS like the following screenshot. It says “There are currently no pinned applications, Add an application here or Pin an item to the dash”.

Heimdall is running and the GUI says "There are currently no pinned applications, Add an application here or Pin an item to the dash".

Let’s add an entry to see if it works. To see it on the homepage, i.e., pinned, make sure to click “PINNED” on the top right before you hit the “Save” button.

Add application page in Heimdall

As seen below, we successfully added LGTM.cf website to homepage!

The front page of Heimdall during test run

Step 4 — Auto-start Heimdall using systemd service

We are almost done, except we want it to start automatically after we install Heimdall when Ubuntu 20.04 reboots even after an power outage.

We will use systemd to to auto start Heimdall dashboard when the OS boots. Add the file heimdall.service in /etc/systemd/system/.

sudo vim /etc/systemd/system/heimdall.service

Add the following content to the file. Make sure you change the user, group, and WorkingDirectory as yours. I also used an uncommon port 7889, you might want to change it if you want. If you access Heimdall from another computer, add --host 0.0.0.0 after 7889.

[Unit]
Description=Heimdall
After=network.target

[Service]
Restart=always
RestartSec=5
Type=simple
User=lgtm
Group=lgtm
WorkingDirectory=/home/lgtm/Heimdall-2.2.2
ExecStart="/usr/bin/php" artisan serve --port 7889
TimeoutStopSec=30

[Install]
WantedBy=multi-user.target

To enable the service now, run the following command:

sudo systemctl enable --now heimdall.service

Now open your browser and enter http://127.0.0.1:7889/. You should see the same interface as seen before. Now if you reboot your computer or server, you should still be able to visit the URL. If you added --host 0.0.0.0 before, you’ll need to find and type the IP of your computer instead of 127.0.0.1:7889. You can usually find the IP address in your WiFi/wired network properties or with ifconfig.

The front page of Heimdall

Before we conclude, you might be wondering why not use php-fpm with Apache or Nginx. The reason is that if you are the only user of Heimdall, the current setup will be fine (Thinks of you as the developer). The complexity of using these web servers outweighs the gain of high-performance.

4 steps to install Heimdall dashboard on Ubuntu 20.04

Time Needed : 6 minutes

  1. Download latest Heimdall Dashboard from GitHub

    Run this command to download it from its GitHub release page: RELEASE=$(curl -sX GET "https://api.github.com/repos/linuxserver/Heimdall/releases/latest" | awk '/tag_name/{print $4;exit}' FS='[""]'); echo $RELEASE &&\ curl --silent -o Heimdall-${RELEASE}.tar.gz -L "https://github.com/linuxserver/Heimdall/archive/${RELEASE}.tar.gz"image 4

    Uncompress the downloaded file
    Run tar xvzf Heimdall-*.tar.gzScreenshot from 2020 05 03 23 41 49

  2. Install PHP dependencies on Ubuntu 20.04

    Run sudo apt install php-sqlite3 php-zipScreenshot from 2020 05 03 23 43 08

  3. Add Heimdall systemd service for auto-start

    Add the file by sudo vim /etc/systemd/system/heimdall.service and copy-paste the following content (examine the text in bold, adapt to yours). Append --host 0.0.0.0 to the ExecStart line if you will access it from another computer.

    [Unit]
    Description=Heimdall
    After=network.target
    [Service]
    Restart=always
    RestartSec=5
    Type=simple
    User=lgtm
    Group=lgtm
    WorkingDirectory=/home/lgtm/Heimdall-2.2.2
    ExecStart="/usr/bin/php" artisan serve --port 7889
    TimeoutStopSec=30
    [Install]
    WantedBy=multi-user.target
    Screenshot from 2020 05 03 23 56 16

  4. Enable systemd service on Ubuntu 20.04

    Use systemctl enable –now: sudo systemctl enable --now heimdall.serviceScreenshot from 2020 05 03 23 18 19

Tools
  • Linux OS
  • Terminal
  • curl
  • awk
  • systemd
  • vim
Materials
  • Linux

+10

By VarHowto Editor

Welcome to VarHowto!

8 replies on “How to Install Heimdall Dashboard on Ubuntu 20.04”

Great tutorial,
But where can I find the php.ini file?
I ‘d like to upload bigger images for the background.
Thanks in advance

+1

Hi
You say “To fix it, edit the ArrayInput.php at line 135 with vim ./vendor/symfony/console/Input/ArrayInput.php +135 and comment on the elseif line and what’s inside. The following screenshot shows the 2 lines.”
When I run that, I get a blank screen:

~
~
~
~
~
~
~
~
~
~
<fony/console/Input/ArrayInput.php” [New DIRECTORY] 0,0-1 All

Any suggestions please?

Thanks

Merlin

0

great guide! please update it to include nash’s note above. many people (if not most) won’t be installing and running this on their local host. without the --host 0.0.0.0 appeneded to the systemctl service file, the server webpage isn’t accessible. props to nash for posting his comment. you saved the day bro!

+2

Thank you! Very easy to follow πŸ™‚

I’m running this on a FreeNAS vm so I needed to add --host 0.0.0.0 before --port 7889 in heimdall.service in order to access it remotely.

+4

Comments are closed.