-
Notifications
You must be signed in to change notification settings - Fork 145
Guide for TasmoAdmin on Docker
A Docker image for TasmoAdmin. TasmoAdmin is an administrative Website for Devices flashed with Sonoff-Tasmota.
This image is based on Linux Alpine with Nginx and PHP 7 installed.
Install Docker Desktop.
Once installed and setup open your command prompt and run:
docker run -it -p 8000:80 ghcr.io/tasmoadmin/tasmoadmin:latest
This will download and start the the application which should be available at http://localhost:8000
You can mount a volume to ensure that data is persisted between restarts.
docker run -it -p 8080:80 -v C:/TasmoAdmin:/data ghcr.io/tasmoadmin/tasmoadmin:latest
Make sure the directory you're mounting on the host exists before hand. in the example above this is C:/TasmoAdmin
.
Install docker using your distributions preferred method.
Once installed and setup open your terminal and run:
docker run -it -p 8000:80 ghcr.io/tasmoadmin/tasmoadmin:latest
This will download and start the the application which should be available at http://localhost:8000
You can mount a volume to ensure that data is persisted between restarts.
docker run -it -p 8080:80 -v /path/to/data:/data ghcr.io/tasmoadmin/tasmoadmin:latest
Where /path/to/data
is the path where you want the data persisted. It must exist before starting.
You can also use SSL with a self signed certificate.
docker run -d -p 8443:443 -e SSL=true -v /path/to/data:/data ghcr.io/tasmoadmin/tasmoadmin:latest
You can add your own certificate by replacing tasmoadmin.key and tasmoadmin.crt which are stored in /path/to/data/nginx/certs
Portainer is OPTIONAL, if you dont want it, ignore the portainer lines.
Tested on: Rasbian(2018-06-27 stretch), Openhasbian(openhabianpi-raspbian-201804031720),
#install docker
curl -sSL https://get.docker.com | sh
#create dirs for Docker Volumes(data)
mkdir /home/pi/Docker/Portainer/data -p
mkdir /home/pi/Docker/TasmoAdmin/data -p
# Install Portainer
sudo docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v /home/pi/Docker/Portainer/data:/data --name=Portainer --restart=always portainer/portainer
# Install tasmoadmin
sudo docker run -d -p 5555:80 -v /home/pi/Docker/TasmoAdmin/data:/data --name=TasmoAdmin --restart=always ghcr.io/tasmoadmin/tasmoadmin:latest
# Install tasmoadmin BETA if you want
sudo docker run -d -p 5556:80 -v /home/pi/Docker/TasmoAdmin/data:/data --name=TasmoAdmin-BETA --restart=always ghcr.io/tasmoadmin/tasmoadmin:beta
# Install tasmoadmin DEV if you want
sudo docker run -d -p 5557:80 -v /home/pi/Docker/TasmoAdmin/data:/data --name=TasmoAdmin-DEV --restart=always ghcr.io/tasmoadmin/tasmoadmin:dev
# Check if containers r running
sudo docker ps
- arm32v6 (i.e. Raspberry PI 1, 2, 3 and Zero)
- amd64 (i.e. Synology DSM)
note: docker will detect which architecture you have and downloads the correct image for it.
It's highly recommended to use the volume option to persist/store your TasmoAdmin config outside the container.
Syntax:
docker run -it -v <directory_host>:<directory_container> -p <host_port>:<container_port> --name <container_name> ghcr.io/tasmoadmin/tasmoadmin:latest
Example:
docker run -it -v /host/data:/data -p 80:80 --name tasmoadmin ghcr.io/tasmoadmin/tasmoadmin:latest
In the above example the url is http://<your_host_ip> which opens TasmoAdmin.
Example with autostart and automatically restart
sudo docker run -d --restart unless-stopped -v /home/hass/.homeassistant/docker:/data -p 8124:80 --name tasmoadmin ghcr.io/tasmoadmin/tasmoadmin:latest
Above example starts the docker image on port 8124.The path has to be adapted to your installation
Description:
docker run - run this container... and build locally if necessary first.
-it - atInstall TasmoAdmin on a Synology NAS running Docker
Docker UI (Synology):
Login to DSM
Go To Docker -> Registry
Add https://ghcr.io (will end in an error but the image will appear in the Synology Docker app later and it even recognizes the registry (https://ghcr.io))
Terminal:
SSH login via putty to DSM
sudo -i
docker pull ghcr.io/tasmoadmin/tasmoadmin:latest
Docker UI (Synology):
Login to DSM
Go to Docker -> image/launch
Advanced Settings
Enable auto-restart
set Local Ports (not automatic)
Volume -> persistent pathtach a terminal session so we can see what is going on.
-v /host/data:/data - /host/data is a host directory which is linked to the /data directory inside the container.
-p 9999:80 - connect local port 9999 to the exposed internal port 80.
--name tasmoadmin - give this container a friendly local name.
ghcr.io/tasmoadmin/tasmoadmin:latest - the image to base it on
Install TasmoAdmin on a Synology NAS running Docker
-
Docker UI (Synology): Login to DSM Go To Docker -> Registry Add https://ghcr.io/ (will end in an error but the image will appear in the Synology Docker app later and it even recognizes the registry (https://ghcr.io/))
-
Terminal: SSH login to DSM
sudo -i docker pull ghcr.io/tasmoadmin/tasmoadmin:latest
-
Docker UI (Synology): Login to DSM Go to Docker -> image/launch Advanced Settings Enable auto-restart set Local Ports (not automatic) Volume -> persistent path