Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/antlafarge/jdownloader

Docker JDownloader 2 headless image with automatic updates.
https://github.com/antlafarge/jdownloader

alpine bash docker docker-container java jdownloader jre myjdownloader openjdk shell ubuntu

Last synced: 1 day ago
JSON representation

Docker JDownloader 2 headless image with automatic updates.

Awesome Lists containing this project

README

        

# JDownloader 2

Docker JDownloader 2 headless image with automatic updates.

There is no embedded graphical interface, you should manage your downloads through the official JDownloader web interface here : [https://my.jdownloader.org](https://my.jdownloader.org).

Dockerhub repository : [https://hub.docker.com/r/antlafarge/jdownloader](https://hub.docker.com/r/antlafarge/jdownloader).
Github repository : [https://github.com/antlafarge/jdownloader](https://github.com/antlafarge/jdownloader).
You can report issues in the [github issues](https://github.com/antlafarge/jdownloader/issues).
You can send feedback and discuss the project in the [github discussions](https://github.com/antlafarge/jdownloader/discussions).

# Supported architectures and Tags

| arch \ tags | [`latest`](https://hub.docker.com/repository/docker/antlafarge/jdownloader/tags?page=1&ordering=last_updated&name=latest)
[`ubuntu`](https://hub.docker.com/repository/docker/antlafarge/jdownloader/tags?page=1&ordering=last_updated&name=ubuntu)
[`ubuntu-openjdk21`](https://hub.docker.com/repository/docker/antlafarge/jdownloader/tags?page=1&ordering=last_updated&name=ubuntu-openjdk21)
[`openjdk21`](https://hub.docker.com/repository/docker/antlafarge/jdownloader/tags?page=1&ordering=last_updated&name=openjdk21) | [`alpine`](https://hub.docker.com/repository/docker/antlafarge/jdownloader/tags?page=1&ordering=last_updated&name=alpine)
[`alpine-openjdk21`](https://hub.docker.com/repository/docker/antlafarge/jdownloader/tags?page=1&ordering=last_updated&name=alpine-openjdk21) |
| :--------: | :--------------------: | :--------: |
| **linux/amd64** | OK | OK |
| **linux/arm/v7** | OK | NA |
| **linux/arm64/v8** | OK | OK |
| **linux/ppc64le** | [*Need feedback*](https://github.com/antlafarge/jdownloader/discussions) | [*Need feedback*](https://github.com/antlafarge/jdownloader/discussions) |
| **linux/riscv64** | NA | [*Need feedback*](https://github.com/antlafarge/jdownloader/discussions) |
| **linux/s390x** | [*Need feedback*](https://github.com/antlafarge/jdownloader/discussions) | [*Need feedback*](https://github.com/antlafarge/jdownloader/discussions) |

### Other available tags :
- [`openjdk17`](https://hub.docker.com/repository/docker/antlafarge/jdownloader/tags?page=1&ordering=last_updated&name=openjdk17) [`ubuntu-openjdk17`](https://hub.docker.com/repository/docker/antlafarge/jdownloader/tags?page=1&ordering=last_updated&name=ubuntu-openjdk17)
- [`alpine-openjdk17`](https://hub.docker.com/repository/docker/antlafarge/jdownloader/tags?page=1&ordering=last_updated&name=alpine-openjdk17)
- [`openjdk8`](https://hub.docker.com/repository/docker/antlafarge/jdownloader/tags?page=1&ordering=last_updated&name=openjdk8) [`ubuntu-openjdk8`](https://hub.docker.com/repository/docker/antlafarge/jdownloader/tags?page=1&ordering=last_updated&name=ubuntu-openjdk8)
- [`alpine-openjdk8`](https://hub.docker.com/repository/docker/antlafarge/jdownloader/tags?page=1&ordering=last_updated&name=alpine-openjdk8) (use this tag for architectures **linux/386** and **linux/arm/v6**)

# [Docker Compose](https://docs.docker.com/compose)


services:
jdownloader:
image: antlafarge/jdownloader:<TAG>
container_name: <CONTAINER-NAME> # Optional
restart: <RESTART> # Optional
user: <UID>:<GID> # Optional
volumes:
- "<DOWNLOADS-PATH>:/jdownloader/downloads/"
- "<CONFIG-PATH>:/jdownloader/cfg/" # Optional
- "<LOGS-PATH>:/jdownloader/logs/" # Optional
environment:
- "JD_EMAIL=<JD-EMAIL>" # Optional (better to use secrets)
- "JD_PASSWORD=<JD-PASSWORD>" # Optional (better to use secrets)
- "JD_DEVICENAME=<JD-DEVICENAME>" # Optional
- "UMASK=<UMASK>" # Optional
- "JAVA_OPTIONS=<JAVA-OPTIONS>" # Optional
- "LOG_FILE=<LOG-FILE>" # Optional
secrets:
- JD_EMAIL
- JD_PASSWORD
- JD_DEVICENAME # Optional
ports:
- "<PORT>:3129" # Optional

secrets:
JD_EMAIL:
file: "<JD-EMAIL-FILE>" # Put your myJD email in this file
JD_PASSWORD:
file: "<JD-PASSWORD-FILE>" # Put your myJD password in this file
JD_DEVICENAME: # Optional
file: "<JD-DEVICENAME-FILE>" # Put your myJD device name in this file

See example


services:
jdownloader:
image: antlafarge/jdownloader:latest
container_name: jdownloader
restart: on-failure:10
user: 1000:100
volumes:
- "/hdd/JDownloader/downloads/:/jdownloader/downloads/"
- "/hdd/JDownloader/cfg/:/jdownloader/cfg/"
secrets:
- JD_EMAIL
- JD_PASSWORD
- JD_DEVICENAME
ports:
- "3129:3129"
secrets:
JD_EMAIL:
file: "/hdd/JDownloader/secrets/JD_EMAIL.txt"
JD_PASSWORD:
file: "/hdd/JDownloader/secrets/JD_PASSWORD.txt"
JD_DEVICENAME:
file: "/hdd/JDownloader/secrets/JD_DEVICENAME.txt"

## Parameters

Name | Type | Description | Optional | Default
---- | ---- | ----------- | -------- | -------
**``** | [Tag](https://docs.docker.com/engine/reference/run/#image-references) | Docker hub tag. | Optional | `latest`
**``** | [Name](https://docs.docker.com/reference/cli/docker/container/run/#name) | Container name. | Recommended | Random
**``** | [Restart](https://docs.docker.com/reference/cli/docker/container/run/#restart) | Container restart policy.
*Use `on-failure` to have a correct behavior of `Restart`, `Close` and `Shutdown` buttons in the JDownloader settings.* | Recommended | `no`
**``** | [User](https://docs.docker.com/engine/reference/run/#user) | Owner user ID of the files and directories created.
*Use the command `id -u` in your shell to get your current user id.* | Recommended | `0` (root)
**``** | [User](https://docs.docker.com/engine/reference/run/#user) | Owner group ID of the files and directories created.
*Use the command `id -g` in your shell to get your current groud id.* | Recommended | `0` (root)
**``** | [Volume](https://docs.docker.com/reference/cli/docker/container/run/#volume) | Directory where your downloads will be stored on your host machine.
*If you use the `user` parameter, check the permissions of the directories you mount as volumes.* | **REQUIRED** |
**``** | [Volume](https://docs.docker.com/reference/cli/docker/container/run/#volume) | Directory where the JDownloader settings files will be stored on your host machine.
*If you use the `user` parameter, check the permissions of the directories you mount as volumes.* | Recommended | In container
**``** | [Volume](https://docs.docker.com/reference/cli/docker/container/run/#volume) | Directory where the JDownloader log files will be stored on your host machine.
*If you use the `user` parameter, check the permissions of the directories you mount as volumes.* | Not recommended | In container
**``** | [Secret](https://docs.docker.com/compose/use-secrets/) | The path to the docker secret file where your [myJDownloader](https://my.jdownloader.org) e-mail is saved. | **REQUIRED** |
**``** | [Secret](https://docs.docker.com/compose/use-secrets/) | The path to the docker secret file where your [myJDownloader](https://my.jdownloader.org) password is saved. | **REQUIRED** |
**``** | [Secret](https://docs.docker.com/compose/use-secrets/) | The path to the docker secret file where your [myJDownloader](https://my.jdownloader.org) device name is saved. | Optional | (hostname)
**``** | [Env](https://docs.docker.com/reference/cli/docker/container/run/#env) | Java options.
*Use `-Xms128m -Xmx1g` to change initial and max Java heap size memory.* | Optional | Empty
**``** | [Env](https://docs.docker.com/reference/cli/docker/container/run/#env) | Change the *umask*. | Optional | No change
**``** | [Env](https://docs.docker.com/reference/cli/docker/container/run/#env) | Device name in your [myJDownloader web interface](https://my.jdownloader.org). | Optional | Hostname
**``** | [Env](https://docs.docker.com/reference/cli/docker/container/run/#env) | Your [myJDownloader](https://my.jdownloader.org) e-mail.
I recommend to use the docker secrets (cf. ``). | Not recommended |
**``** | [Env](https://docs.docker.com/reference/cli/docker/container/run/#env) | Your [myJDownloader](https://my.jdownloader.org) password.
I recommend to use the docker secrets (cf. ``). | Not recommended |
**``** | [Env](https://docs.docker.com/reference/cli/docker/container/run/#env) | Write JDownloader logs from `java` command in a file.
You should use the volume parameter **``** to access these log files from the host machine.
Useful if you want to investigate any issues with JDownloader.
Example : `"/jdownloader/logs/jd.docker.log"`. | Not recommended | `/dev/null`
**``** | [Port](https://docs.docker.com/reference/cli/docker/container/run/#publish) | Network port used for Direct connection mode. | Optional | Not exposed

# [Docker run](https://docs.docker.com/engine/reference/run)

See Docker run


docker run -d \
--name <CONTAINER-NAME> \
--restart <RESTART> \
--user <UID>:<GID> \
-v "<DOWNLOADS-PATH>:/jdownloader/downloads/" \
-v "<CONFIG-PATH>:/jdownloader/cfg/" \
-v "<LOGS-PATH>:/jdownloader/logs/" \
-e "JD_EMAIL=<JD-EMAIL>" \
-e "JD_PASSWORD=<JD-PASSWORD>" \
-e "JD_DEVICENAME=<JD-DEVICENAME>" \
-e "JAVA_OPTIONS=<JAVA-OPTIONS>" \
-e "LOG_FILE=<LOG-FILE>" \
-e "UMASK=<UMASK>" \
-p "<PORT>:3129" \
antlafarge/jdownloader:<TAG>

*Note : Parameters indented twice are optional.*

Example :


docker run -d \
--name jdownloader \
--restart on-failure:10 \
--user 1000:100 \
-v "/hdd/JDownloader/downloads/:/jdownloader/downloads/" \
-v "/hdd/JDownloader/cfg/:/jdownloader/cfg/" \
-e "JD_EMAIL=[email protected]" \
-e "JD_PASSWORD=MyGreatPassword" \
-e "JD_DEVICENAME=JD-DOCKER" \
-p 3129:3129 \
antlafarge/jdownloader:latest

# Guides

## Setup

- Go to [my.jdownloader.org](https://my.jdownloader.org) and create an account.
- If you want to run the container as an unprivileged user, use the `user` parameter and check the access permissions of the directories you mount as volumes
- Create the downloads directory : `mkdir /path/to/jdownloader/downloads/`
- Setup the user and group owners : `sudo chown -R 1000:100 /path/to/jdownloader/downloads/`
- You can get your User ID (UID) by using : `id -u`
- You can get your User Group ID (GID) by using : `id -g`
- I recommend to use `100` as GID (`users` group), because every users should be in this group, and it will be easier to manage multi-users privileges.
- Setup the downloads directory access permissions : `sudo chmod -R 770 /path/to/jdownloader/downloads/`
- Setup the config directory access permissions : `sudo chmod -R 770 /path/to/jdownloader/cfg/`
- Setup the secrets directory access permissions : `sudo chmod -R 770 /path/to/jdownloader/secrets/`
- Create the secret file for your JD e-mail : `echo '[email protected]' > /path/to/jdownloader/secrets/JD_EMAIL.txt`
- Create the secret file for your JD password : `echo 'MyGreatPassword' > /path/to/jdownloader/secrets/JD_PASSWORD.txt`
- Create the secret file for your JD device name : `echo 'JD-DOCKER' > /path/to/jdownloader/secrets/JD_DEVICENAME.txt`
- Run the container by choosing the [docker run](https://github.com/antlafarge/jdownloader#docker-run) or [docker compose](https://github.com/antlafarge/jdownloader#docker-compose) method and customize the parameters by using your [myJDownloader](https://my.jdownloader.org) credentials.
- You can check the container logs : `docker logs --follow --tail 100 jdownloader` (`CTRL + C` to quit)
- Wait some minutes for JDownloader to update and be available in your [myJDownloader web interface](https://my.jdownloader.org).

## Update JDownloader

JDownloader will update itself automatically when it is idle (every 12 hours), so you have nothing to do.
To disable the automatic upates, go to your JD instance on [my.jdownloader.org](https://my.jdownloader.org), and go to `Settings` / `Event Scripter` and switch from `Enabled` to `Disabled`.

## Update the image

- [Docker compose](https://github.com/antlafarge/jdownloader#docker-compose) method :
- Update the image : `docker compose pull jdownloader`
- Recreate the container : `docker compose up --force-recreate -d jdownloader`
- Remove the old untagged images : `docker image prune -f`
- [Docker run](https://github.com/antlafarge/jdownloader#docker-run) method :
- Update the image : `docker pull antlafarge/jdownloader:latest`
- Remove the current container : `docker rm -f jdownloader`
- Remove the old untagged images : `docker image prune -f`
- Start the container : `docker run ...`

## Change your email or password

- If you used the docker secrets, just change it in the secrets files and restart your docker container.
- If you started the container by setting the email and password environment variables :
- You must follow the [Update the image](https://github.com/antlafarge/jdownloader#update-the-image) guide by setting the new email or password on the final step.

## Special characters in password

1. If you used the docker secrets, put the raw password in the secret file without escaping any character.

2. If you want to use environment variables, modify your [docker run](https://github.com/antlafarge/jdownloader#docker-run) command or [docker-compose.yml](https://github.com/antlafarge/jdownloader#docker-compose) file :
- If you have exclamation marks (`!`) in your password and you use a **bash** shell, this special character corresponds to commands history substitution. You might need to disable it by using the command `set +H` in your bash shell.
- If your password contains double quotes (`"`), escape it with backslashes (`\`) in the [docker run](https://github.com/antlafarge/jdownloader#docker-run) command or [docker-compose.yml](https://github.com/antlafarge/jdownloader#docker-compose) file. ``"JD_PASSWORD=My\"Great`Password"``
- If you use the [docker run](https://github.com/antlafarge/jdownloader#docker-run) method, also escape backticks (`` ` ``) with backslashes (`\`). ``"JD_PASSWORD=My\"Great\`Password"``
- Start the container.

3. If you want to put your password manually in the settings file :
- Modify your [docker run](https://github.com/antlafarge/jdownloader#docker-run) command or [docker-compose.yml](https://github.com/antlafarge/jdownloader#docker-compose) file parameters :
- Set an empty `` (for disabling password replacement on container start). `"JD_PASSWORD="`
- Set a `` volume to access the JDownloader settings files.
- Start the container.
- Go to your config directory and open the settings file named `org.jdownloader.api.myjdownloader.MyJDownloaderSettings.json`.
- Search for the password field and place your password in the empty double quotes. `"password":"MyGreatPassword",`
- If your password contains double quotes (`"`), escape it with backslashes (`\`). ``"password":"My\"Great`Password",``
- Save the file and restart the container. `docker restart jdownloader`

# Troubleshooting

## Files permissions issue

Check the user you use to run the container (with `user` parameter) can read and write the directories you created and you mounted as [volumes](https://docs.docker.com/engine/reference/run/#volume-shared-filesystems).
Read carefully the [Setup guide](https://github.com/antlafarge/jdownloader#setup) and follow the steps.
Or run the container as root (remove `user` parameter).

## Armhf libseccomp2 issue

If you run the image on an armhf host (`arm/v7`), you may encounter many command errors (`wait`, `sleep`, `curl`, `date`)
This may be resolved by upgrading the `libseccomp2` library (docker dependency).
First you should try to upgrade your system by using the usual method.
If this upgrade didn't resolve the problem, add the backports repo for debian buster and update :
```
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 04EE7237B7D453EC 648ACFD622F3D138
echo "deb http://deb.debian.org/debian buster-backports main" | sudo tee -a /etc/apt/sources.list.d/buster-backports.list
sudo apt update
sudo apt install -t buster-backports libseccomp2
```

## Docker privileges

If many internal commands fail, your container may lack some privileges and you can try the [--privileged](https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities) flag.

## Nothing worked / another issue

You can report issues in the [github issues](https://github.com/antlafarge/jdownloader/issues).
You can send feedback and discuss the project in the [github discussions](https://github.com/antlafarge/jdownloader/discussions).

# Docker commands reminder

## Container stop


docker stop jdownloader

## Container restart


docker restart jdownloader

## Container logs


docker logs --follow --tail 100 jdownloader

*Note: To access the JDownloader log files, you have to set the `` volume.*

## Container delete


docker rm -f jdownloader

## Image delete


docker rmi antlafarge/jdownloader:openjdk17

## Compose start


cd /path/to/docker-compose.yml/directory/
docker compose up -d

## Compose stop


cd /path/to/docker-compose.yml/directory/
docker compose down