Docker-Compose Method - Recommended
Install Docker
Update the repo to get latest versions
sudo apt update
Install the latest version
sudo apt install docker.io
Set Docker to start on startup
sudo systemctl enable --now docker
Give your user permissions to docker, replacing user
with your username
sudo usermod -aG docker user
Once you have run this command close and reopen your session if you accessing remotely. This is to apply the permissions in the above step
Test it has installed correctly by getting the docker version
docker --version
Docker Compose
I also install docker-compose as some dockers need you to compose from a yml file. This downloads v2.16.0, just change this if the version updates to a later version
sudo curl -L "https://github.com/docker/compose/releases/download/v2.16.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
Give permissions to this
sudo chmod +x /usr/local/bin/docker-compose
Test it has installed correctly by getting the docker-compose version
docker-compose --version
Install Homer
I keep all my dockers in a dockers folder in my home directory. If it doesn’t exist already, create this folder:-
mkdir ~/dockers
Now create a folder for Homer to live in.
mkdir ~/dockers/homer
Create a folder for the assets
mkdir ~/dockers/homer/assets
Change directory to this folder
cd ~/dockers/homer
Create a docker-compose.yml file
nano docker-compose.yml
Paste the following. Change the 89
part of 89:8080
if you want it to listen on an alternative port to port 89.
---
version: "2"
services:
homer:
image: b4bz/homer
container_name: homer
volumes:
- ./assets/:/www/assets
ports:
- 89:8080
environment:
- UID=1000
- GID=1000
restart: unless-stopped
Save the file with ctl + x, then y to save.
Run the docker-compose file with the following:-
docker-compose up -d
- Browse to the server ip and the port mentioned in the compose file, eg http://1.1.1.1:89 and you should get the default dashboard.
-
Now it’s all installed, to configure, edit the following file.
sudo nano /home/dockers/homer/assets/config.yml
Nginx Method
Installing nginx if it’s not installed
-
First, update the repo to get latest versions
sudo apt update
-
Install nginx
sudo apt install nginx
-
Enable the service to start on boot
sudo systemctl enable nginx
Installing Homer Dashboard
-
First download the latest release from the github repo. From your home directory run the following.
wget "https://github.com/bastienwirtz/homer/releases/latest/download/homer.zip"
-
Next, extract homer into the nginx folder
sudo unzip homer.zip -d /usr/share/nginx/homer
-
If the above command fails because you haven’t got unzip intalled, use the following to install, then re-run the above command.
sudo apt install unzip
-
Amend the permissions on the homer folder
sudo chown www-data:www-data /usr/share/nginx/homer/ -R
-
Get the default config from homer dist
sudo cp /usr/share/nginx/homer/assets/config.yml.dist /usr/share/nginx/homer/assets/config.yml
-
Create nginx config file
sudo nano /etc/nginx/conf.d/homer.conf
-
Paste the following in for a basic site setup (change the
server_name
for your server name/ip. Changelisten
to a port you want this to listen on. I’m using :89 as my custom port. The default from homer docker is 8080, so you would uselisten 8080
in the below along withlisten [::]:8080
)server { listen 89; listen [::]:89; server_name homer.example.com; # Path to the root of your installation root /usr/share/nginx/homer/; access_log /var/log/nginx/homer.access; error_log /var/log/nginx/homer.error; }
-
Test the nginx config.
sudo nginx -t
-
If the above comes back successfully, restart nginx service.
sudo systemctl reload nginx
-
Browse to the site mentinoed in the config file, eg http://homer.example.com:89 and you should get the default dashboard.
-
Now it’s all installed, to configure, edit the following file.
sudo nano /usr/share/nginx/homer/assets/config.yml