Installation on Docker
toddrob edited this page Jul 7, 2020
·
4 revisions
- Install Docker
- Create a folder to store your Addarr files. For the example we will use
/var/lib/addarr
. - Save a copy of config_example.yaml to your Addarr folder (
/var/lib/addarr/config.yaml
). Edit the file to add your settings. - Create
admin.txt
andchatid.txt
in your Addarr folder (/var/lib/addarr/admin.txt
and/var/lib/addarr/chatid.txt
).- If you are using the admin restriction functionality, paste your admin Telegram chat id(s) in
admin.txt
, one on each line. - You can paste your Telegram chat id(s) in
chatid.txt
, but you don't need to. You can leave this file empty, and chat ids will be added when they are authorized via password through the bot.
- If you are using the admin restriction functionality, paste your admin Telegram chat id(s) in
- If you want the Addarr log file to be saved on your host system, then create a
logs
folder in your Addarr folder (/var/lib/addarr/logs/
). Skip this step if you don't care about the log file, and it will be erased each time the Docker container is stopped.
- Save a copy of docker-compose.yml to your Addarr folder (
/var/lib/addarr/docker-compose.yml
). - Edit
docker-compose.yml
and make sure the file/folder mappings are correct for your environment. The default includes mappings forconfig.yaml
,chatid.txt
, andadmin.txt
all being in the same folder asdocker-compose.yml
. If you also want to map alogs
folder, add a line to map that folder as well:- ./logs:/app/logs:rw
. Here is whatdocker-compose.yml
should look like with thelogs
folder also mapped:
volumes:
- ./config.yaml:/app/config.yaml:ro
- ./chatid.txt:/app/chatid.txt:rw
- ./admin.txt:/app/admin.txt:ro
- ./logs:/app/logs:rw
- Make sure your current working directory is your Addarr folder (
cd /var/lib/addarr
) and run the commanddocker-compose up -d
to create and start a docker container based on the settings indocker-compose.yml
.- Note: You will need to run all Docker commands as root or using sudo. On Windows you will need to run your command prompt as an admin.
- To update your docker image to the latest version of Addarr, run the following commands:
-
docker-compose pull
(to pull the new version of the image from Docker Hub) -
docker-compose down
(stop and destroy the current container--your config will be safe since you mapped them to persistent files) -
docker-compose up -d
(create and start a new container)
-
It is much easier to use Docker Compose, because the settings are stored in YAML and you don't have to remember your settings every time you want to upgrade the Addarr version.
- Use the
docker pull
command to retrieve the latest Addarr image:docker pull waterboy1602/addarr:latest
. - Use the
docker create
command to create a container. For example:
docker create \
--name=addarr \
-v ./config.yaml:/app/config.yaml:ro \
-v ./chatid.txt:/app/chatid.txt:rw \
-v ./admin.txt:/app/admin.txt:ro \
-v ./logs:/app/logs:rw \
--restart unless-stopped \
waterboy1602/addarr:latest
Note: If you run this command from outside your Addarr folder, you will need to include the full paths for each -v
mapped volume/file (e.g. -v /var/lib/addarr/config.yaml:/app/config.yaml:ro \
).
- Use the
docker start
command to start your container:docker start addarr
- To update your docker image to the latest version of Addarr, use the following commands:
-
docker pull waterboy1602/addarr:latest
(to pull the new version of the image from Docker Hub) -
docker stop addarr
(to stop the current container) -
docker container rm addarr
(to delete the current container) - Repeat your
docker create
command from above (to create a new container using the new image) -
docker start addarr
(to start the new container)
-
Thanks for help with Docker support: @tedvdb, @schoentoon, and @toddrob99.