Homepage dashboard in Docker: collect HomeLab services on port 8006
TABLE OF CONTENTS (Nhấn để xem)
Homepage is a fast, static, customizable dashboard for collecting HomeLab services. The i12bretro tutorial uses Docker, stores configuration under ~/homepage, and mounts the Docker socket so Homepage can discover containers through labels.1
Install Docker
Log in to the Linux Docker host and run:
# install prerequisites
sudo apt install apt-transport-https ca-certificates curl software-properties-common gnupg-agent -y
# add docker gpg key
curl -fsSL https://download.docker.com/linux/$(awk -F'=' '/^ID=/{ print $NF }' /etc/os-release)/gpg | sudo apt-key add -
# add docker software repository
sudo add-apt-repository "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/$(awk -F'=' '/^ID=/{ print $NF }' /etc/os-release) $(lsb_release -cs) stable"
# install docker
sudo apt install docker-ce docker-compose containerd.io -y
# enable and start docker service
sudo systemctl enable docker && sudo systemctl start docker
# add the current user to the docker group
sudo usermod -aG docker $USER
# reauthenticate for the new group membership to take effect
su - $USER
Run Homepage
The source first checks the UID/GID, creates the configuration directory, and runs the container. Check the UID/GID of the user that will run the container, then set PUID/PGID:
# list current uid and gid, note these for later
id $user
# make a homepage directory to mount in the container
mkdir ~/homepage -p
# run the homepage docker image
# replace PUID, GUID with the output of the id $user command above
docker run -d --name=homepage -e PUID=1000 -e PGID=1000 -p 8006:3000 -v ~/homepage:/app/config -v /var/run/docker.sock:/var/run/docker.sock --restart unless-stopped ghcr.io/benphelps/homepage
Open http://DNSorIP:8006. Host port 8006 maps to container port 3000, while the configuration persists in ~/homepage.
Docker socket permissions
Mounting /var/run/docker.sock lets Homepage communicate with the Docker daemon, so it is sensitive access. Keep port 8006 on the management network, do not expose it without authentication, and back up ~/homepage before editing YAML. If the dashboard only needs static links, omit the socket and configure services manually.
Sources
https://i12bretro.github.io/tutorials/0859.html — i12bretro tutorial 0859. ↩︎