This tutorial will show you how to install Heimdall with Docker on Ubuntu 20.04. Overall, you will learn how to install Docker, create a config directory for Heimdall dashboard, and run Heimdall Docker image.
Heimdall Dashboard & Docker
Heimdall is a web-based application dashboard. You can use it to organize and monitor self-hosted applications like radarr, sonarr, plex, emby, and torrent applications like transmission or deluge with live stats. Earlier, we’ve covered how to install Heimdall without Docker on Ubuntu 20.04, but if Docker is the preferred way for you to install Heimdall and run it, this tutorial will show you how to install Heimdall with Docker on Ubuntu 20.04.
With Docker, you don’t have to worry if your Heimdall will auto-start, because Docker daemon will take care of it. You also don’t need to worry about installing dependencies. One downside would be that, if you have Nginx or Apache web server running out site, the Heimdall container will start a web server inside it. But the advantages outweigh the disadvantages, which is probably why you prefer Docker. No more talks, let’s dive in.
You should have access to the terminal or can
ssh into your machine.
The user you used to log in should have root access. This is needed to install Docker and Heimdall system-wide.
Install Docker on Ubuntu 20.04
Before we install Heimdall dashboard using Docker, we will need to install Docker first. Here we choose to install Docker from its official repository instead of the official Ubuntu 20.04 repository as it can become outdated soon.
Install the required software
First, we will need to install the necessary software for Docker installation. These include apt-transport-https, ca-certificates, curl, gnupg-agent, and software-properties-common. You might have already installed them, but using
apt install won’t affect anything.
sudo apt update
sudo apt install \ apt-transport-https \ ca-certificates \ curl \ gnupg-agent \ software-properties-common
After running the commands above, you will see the following output for you to check some details like what new packages will be installed and how much disk space it needed. Type “Y” and press enter, or directly press enter to continue installing them.
Reading package lists… Done Building dependency tree Reading state information… Done ca-certificates is already the newest version (20190110ubuntu1). curl is already the newest version (7.68.0-1ubuntu2). software-properties-common is already the newest version (0.98.9). The following NEW packages will be installed: apt-transport-https gnupg-agent 0 upgraded, 2 newly installed, 0 to remove and 31 not upgraded. Need to get 6,940 B of archives. After this operation, 206 kB of additional disk space will be used. Do you want to continue? [Y/n]
Add official Docker key
Next we’ll add Docker official key to avoid man-in-middle attack to make sure your download the genuine file from docker.com.
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
If you see output “OK”, the key is successfully added.
Set up official Docker Ubuntu repo
Now we’ll add the official Docker repository for Ubuntu 20.04. The following command will add
deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable to the sources.list file automatically:
sudo add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) \ stable"
You will see output similar to the following:
Ign:1 http://dl.google.com/linux/chrome/deb stable InRelease Hit:2 http://archive.ubuntu.com/ubuntu focal InRelease Get:3 http://security.ubuntu.com/ubuntu focal-security InRelease [107 kB] Hit:4 http://dl.google.com/linux/chrome/deb stable Release Hit:5 https://download.docker.com/linux/ubuntu bionic InRelease Get:6 http://archive.ubuntu.com/ubuntu focal-updates InRelease [107 kB] Ign:8 https://download.docker.com/linux/ubuntu focal InRelease Err:9 https://download.docker.com/linux/ubuntu focal Release 404 Not Found [IP: 220.127.116.11 443] Get:10 http://archive.ubuntu.com/ubuntu focal-backports InRelease [98.3 kB] Reading package lists… Done E: The repository 'https://download.docker.com/linux/ubuntu focal Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details.
If you see some error like above, that is because as of the time of writing the focal (the codename of Ubuntu 20.04) branch is not available yet, we will now change
$(lsb_release -cs) to
bionic (the codename of Ubuntu 18.04). If you don’t see any error, do not follow this step.
To change to the Ubuntu 18.04 branch, edit
/etc/apt/sources.list using your favorite editor (nano, vim, emacs) and go to the end of the file, change focal to bionic. Save and quit.
sudo vim /etc/apt/sources.list
apt install Docker
First, we will need to get the up-to-date package information from the Docker Ubuntu repository using
sudo apt update
You will see output like the following:
vh@varhowto-com:~$ sudo apt update Hit:1 http://security.ubuntu.com/ubuntu focal-security InRelease Hit:2 https://download.docker.com/linux/ubuntu bionic InRelease Ign:3 http://dl.google.com/linux/chrome/deb stable InRelease Hit:4 http://dl.google.com/linux/chrome/deb stable Release Hit:5 http://archive.ubuntu.com/ubuntu focal InRelease Get:7 http://archive.ubuntu.com/ubuntu focal-updates InRelease [107 kB] Get:8 http://archive.ubuntu.com/ubuntu focal-backports InRelease [98.3 kB] Fetched 205 kB in 1s (243 kB/s) Reading package lists… Done Building dependency tree Reading state information… Done 31 packages can be upgraded. Run 'apt list --upgradable' to see them.
Next we install Docker and its command line tool through
sudo apt install docker-ce docker-ce-cli containerd.io.
sudo apt install docker-ce docker-ce-cli containerd.io
You will see output like the following. Press enter to proceed.
vh@varhowto-com:~$ sudo apt install docker-ce docker-ce-cli containerd.io Reading package lists… Done Building dependency tree Reading state information… Done The following additional packages will be installed: aufs-tools cgroupfs-mount pigz The following NEW packages will be installed: aufs-tools cgroupfs-mount containerd.io docker-ce docker-ce-cli pigz 0 upgraded, 6 newly installed, 0 to remove and 31 not upgraded. Need to get 85.7 MB of archives. After this operation, 385 MB of additional disk space will be used. Do you want to continue? [Y/n]
Verify Docker installation
After you install Docker, it will auto-start through systemd. To test if docker has been automatically started, use
sudo service docker status:
sudo service docker status
If you see “active (running)” in the output, it means Docker is running:
● docker.service - Docker Application Container Engine Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled) Active: active (running) since Sun 2020-05-10 15:11:01 EDT; 38s ago TriggeredBy: ● docker.socket Docs: https://docs.docker.com Main PID: 9858 (dockerd) Tasks: 11 Memory: 48.7M CGroup: /system.slice/docker.service └─9858 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
Install Heimdall Dashboard with Docker
Now Docker has been installed, we will pull the Heimdall image (dockerfile) and install the dashboard.
Create Heimdall config directory
First, we create a config directory for Heimdall dashboard using the Linux convention:
mkdir -p .config/heimdall/
Get uid and gid
Next we decide which user the process will run by using the command
My uid and gid are both 1001. If yours is 1000, it’s fine as the user
vh is the second one I created. We will use this id when we run the image
Run Heimdall in Docker
With docker, we don’t need to install Heaimdall the traditional way. We will simply run an image will a set of desired parameters and Docker will create a container by pulling it from Docker Hub, so it can run immediately.
sudo docker run \ --name=heimdall \ -e PUID=1001 \ -e PGID=1001 \ -e TZ=America/New_York \ -p 7888:80 \ -p 4443:443 \ -v ~/.config/heimdall/:/config \ --restart unless-stopped \ linuxserver/heimdall
After you run the
docker run command, Docker will pull the latest Heimdall image and initialize it. After you see “Creating app key. This may take a while on slower systems”, it will take a while. When you see “[services.d] done.”, you can access Heimdall dashboard next. By using
--restart, Heimdall will start with docker after reboot.
Here is the full ouput:
Unable to find image 'linuxserver/heimdall:latest' locally latest: Pulling from linuxserver/heimdall 552d4e2d9bdc: Pull complete 0156ccb39baa: Pull complete 780905421ada: Pull complete ff5f651352a9: Pull complete 3a28cbd238d1: Pull complete d1fdf52df0aa: Pull complete 71403085d445: Pull complete Digest: sha256:4ac329c345a9e074630875c3649581fd0b36cd14b2ec8d7244061cf8322e18fe Status: Downloaded newer image for linuxserver/heimdall:latest [s6-init] making user provided files available at /var/run/s6/etc…exited 0. [s6-init] ensuring user provided files have correct perms…exited 0. [fix-attrs.d] applying ownership & permissions fixes… [fix-attrs.d] done. [cont-init.d] executing container initialization scripts… [cont-init.d] 01-envfile: executing… [cont-init.d] 01-envfile: exited 0. [cont-init.d] 10-adduser: executing… ------------------------------------- _ () | | ___ _ __ | | / __| | | / \ | | \__ \ | | | () | |_| |___/ |_| \__/ Brought to you by linuxserver.io ------------------------------------- To support LSIO projects visit: https://www.linuxserver.io/donate/ GID/UID User uid: 1001 User gid: 1001 [cont-init.d] 10-adduser: exited 0. [cont-init.d] 20-config: executing… [cont-init.d] 20-config: exited 0. [cont-init.d] 30-keygen: executing… generating self-signed keys in /config/keys, you can replace these with your own keys if required Generating a RSA private key ……………………..+++++ ……………….+++++ writing new private key to '/config/keys/cert.key' [cont-init.d] 30-keygen: exited 0. [cont-init.d] 50-config: executing… New container detected, installing Heimdall Creating app key. This may take a while on slower systems
Docker options explained
Here we assign the name “heimdall” by
--name=heimdall. So later we can start it by
docker start heimdall.
-e means we set environment variables for who will run the process and the time zone data.
-e PUID= and
-e PGID=1, we used the
vh user, whose id (PUID) is 1001 and group id (PGID) is 1001, to run the Heimdall image.
-e TZ=, we set the time zone to New York, which is the Easter time zone I live in. If you live in other parts of the United States, you can use “America/Chicago” for Central time, and “America/Los_Angeles” for Pacific time. For Alaska and Hawaii, use “America/Anchorage” and “Pacific/Honolulu” respectively. For other countries, here is a list of time zones you can use: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones.
-p, we forward 80 and 443 port in the container to 7888 and 4443 the host machine, which is the one you are currently using or ssh’ing into. Later we will use localhost:7888 to access Heimdall dashboard.
-v, we bind mount a path to
/config in the image. Here we used
~/.config/heimdall/. If you open
~/.config, you will a lot of applications are using it.
linuxserver/heimdall, we pull the image from Docker Hub: https://hub.docker.com/r/linuxserver/heimdall/.
Open Heimdall dashboard
Now open a browser, type or right click localhost:7888 to open Heimdall dashboard that you just installed. You will see the Heimdall web interface as below.
When you want to stop it, use Ctrl-c to stop the container and you will see the following output.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.
[s6-finish] sending all processes the KILL signal and exiting.
To start Heimdall dashboard later, run
sudo docker start heimdall. This time it will exit immediately, but it still runs in the background. To double-check, use
sudo docker ps.
You don’t have to worry if you need to start heimdall dashboard after your computer reboots. We used the
--restart earlier and heimdall container will start when docker starts.
Steps to install Heimdall Dashboard using Docker on Ubuntu 20.04
Time Needed : 5 minutes
- Install Docker for Heimdall dashboard
sudo apt install docker.ioto install Docker from the Ubuntu 20.04 repository. The recommended way is to install through Docker's official repository, please refer to the article to do so.
- Verify Docker is installed
sudo service docker statusand you will see
active (running)in the Active line.
- Create Heimdall config directory
mkdir -p .config/heimdall/
- Run Heimdall container
sudo docker run \
-e PUID=1001 \
-e PGID=1001 \
-e TZ=America/New_York \
-p 7888:80 \
-p 4443:443 \
-v ~/.config/heimdall/:/config \
--restart unless-stopped \
- Visit Heimdall
Open a browser tab and visit http://localhost:7888
- Linux (Ubuntu 20.04)