# Setup & Configuration

We need to install the service through Portainer and configure any necessary settings.

# Preparation

There are some things we need to do in preparation to install this service.

## Volumes

<details id="bkmrk-media-folders-radarr"><summary>Persistent Data</summary>

This is where the service will store its own application data and ensures we can quickly update the service image.

<p class="callout warning">Ensure your user has permissions to access the folder.</p>

</details><details id="bkmrk-download-folder-rada"><summary>Download Folders</summary>

This service will need access to the folder where you will store their completed downloads.

<p class="callout warning">Ensure your user has permissions to access the folder.</p>

</details>## Environment

<details id="bkmrk-tz-this-is-the-curre"><summary>TZ</summary>

This is the current time zone formatted using the [tz database.](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)

<p class="callout info">*For example:* America/Vancouver</p>

</details><details id="bkmrk-gid-%C2%A0"><summary>PUID</summary>

This is the numeric ID of the user account on Debian. If you are unsure, open a terminal and run:

```bash
id -u
```

</details><details id="bkmrk-pgid-this-is-the-num"><summary>PGID</summary>

This is the numeric ID of the user account's group on Debian. If you are unsure, open a terminal and run:

```bash
id -g
```

</details><details id="bkmrk-mod_auto_restart_ena"><summary>MOD\_AUTO\_RESTART\_ENABLED</summary>

aMule is known to have [issues that can cause it to stop working properly after a few days](https://github.com/ngosang/docker-amule#auto-restart-mod). This setting allows the service to be restarted periodically to avoid this issue.

<p class="callout info">*Recommended:* true</p>

</details><details id="bkmrk-mod_auto_share_enabl"><summary>MOD\_AUTO\_SHARE\_ENABLED</summary>

This will automatically share all files and folders found within the MOD\_AUTO\_SHARE\_DIRECTORIES variable.

<p class="callout info">*Recommended:* false</p>

</details>### Passwords

<p class="callout danger">Keep these securely stored in a password manager, such as [VaultWarden](https://hub.subspace.services/books/vaultwarden "VaultWarden").</p>

<details id="bkmrk-owncloud_admin_passw"><summary>GUI\_PWD</summary>

This is the password for the administrator account that will be used within the web interface.

<p class="callout warning">It is important to use secure passphrase that is easy-to-remember.</p>

</details><details id="bkmrk-webui_pwd-this-is-th"><summary>WEBUI\_PWD</summary>

This is the password for the administrator account that will be used within the web interface.

<p class="callout warning">It is important to use secure passphrase that is easy-to-remember.</p>

</details>

# Installation

The service can be installed through the Portainer web interface.

<p class="callout info">Learn about [creating a new stack](https://hub.subspace.services/books/portainer/page/creating-a-new-stack "Creating a New Stack").</p>

## Docker Compose

Use the following code to install the service:

```yaml
---
services:
  amule:
    image: ngosang/amule
    container_name: amule
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=America/Vancouver
      - GUI_PWD=
      - WEBUI_PWD=
      - MOD_AUTO_RESTART_ENABLED=true
      - MOD_AUTO_RESTART_CRON=0 6 * * *
      - MOD_AUTO_SHARE_ENABLED=false
      - MOD_AUTO_SHARE_DIRECTORIES=/incoming
      - MOD_FIX_KAD_GRAPH_ENABLED=true
      - MOD_FIX_KAD_BOOTSTRAP_ENABLED=true
    ports:
      - "4711:4711"
      - "4712:4712"
      - "4662:4662"
      - "4665:4665/udp"
      - "4672:4672/udp" 
    volumes:
      # Persistent Data
      - /srv/amule:/home/amule/.aMule

      # Download Folders
      - /mnt/downloads/incoming:/incoming
      - /mnt/downloads/temp:/temp
    restart: unless-stopped
```

# Updating

<p class="callout success">Re-Deploy the Stack</p>

This service has been optimized for running in Docker.

This allows you to [re-deploy the stack through Portainer](https://hub.subspace.services/books/portainer/page/updating-a-stack "Updating a Stack") to download the latest updates.