# aria2 — Multiverbindungs-Downloads auf der Kommandozeile

> Praxis-Guide zu aria2c — HTTP-, FTP- und BitTorrent-Downloads mit mehreren Verbindungen, Wiederaufnahme-Funktion und JSON-RPC-Daemon.

Source: https://www.jpkc.com/db/cheatsheets/networking/aria2/

<!-- PROSE:intro -->
aria2 ist ein schlanker, protokollübergreifender Download-Manager für die Kommandozeile: Mit `-x` und `-s` teilt er eine einzelne Datei in mehrere Segmente auf und lädt sie gleichzeitig über mehrere Verbindungen herunter – deutlich schneller als klassische Einzel-Verbindungs-Tools. Du kannst HTTP/HTTPS, FTP, BitTorrent und Metalink in einem einzigen Befehl kombinieren, unterbrochene Downloads nahtlos fortsetzen und über die JSON-RPC-Schnittstelle ganze Download-Queues fernsteuern.
<!-- PROSE:intro:end -->

## Grundlegende Downloads

`aria2c <url>` — Lädt eine Datei von einer URL herunter.

```bash
aria2c https://example.com/file.tar.gz
```

`aria2c -o <filename> <url>` — Lädt eine Datei herunter und speichert sie unter einem eigenen Dateinamen.

```bash
aria2c -o backup.tar.gz https://example.com/archive-v2.tar.gz
```

`aria2c -d <dir> <url>` — Lädt in ein bestimmtes Verzeichnis herunter.

```bash
aria2c -d ~/Downloads https://example.com/file.zip
```

`aria2c -c <url>` — Setzt einen teilweise heruntergeladenen Download fort.

```bash
aria2c -c https://example.com/large-file.iso
```

`aria2c -i <file>` — Lädt URLs aus einer Textdatei herunter (eine pro Zeile).

```bash
aria2c -i urls.txt
```

## Mehrfachverbindungen & Geschwindigkeit

`aria2c -x <n> <url>` — Nutzt mehrere Verbindungen zum selben Server (maximale Anzahl pro Host).

```bash
aria2c -x 8 https://example.com/large-file.iso
```

`aria2c -s <n> <url>` — Teilt den Download in N Segmente auf.

```bash
aria2c -s 16 https://example.com/large-file.iso
```

`aria2c -j <n> -i <file>` — Lädt N Dateien gleichzeitig aus einer URL-Liste herunter.

```bash
aria2c -j 5 -i urls.txt
```

`aria2c --max-download-limit=<speed> <url>` — Begrenzt die Download-Geschwindigkeit (z. B. 500K, 2M).

```bash
aria2c --max-download-limit=1M https://example.com/file.iso
```

`aria2c --max-overall-download-limit=<speed> -i <file>` — Begrenzt die Gesamt-Downloadgeschwindigkeit über alle Downloads.

```bash
aria2c --max-overall-download-limit=5M -i urls.txt
```

`aria2c --min-split-size=<size> <url>` — Legt die Mindestgröße für jedes Segment fest.

```bash
aria2c -x 8 --min-split-size=10M https://example.com/file.iso
```

## Mehrere Quellen & Spiegel

`aria2c <url1> <url2> <url3>` — Lädt dieselbe Datei gleichzeitig von mehreren Spiegeln herunter.

```bash
aria2c https://mirror1.example.com/file.iso https://mirror2.example.com/file.iso
```

`aria2c -M <metalink>` — Lädt über eine Metalink-Datei (mehrere Spiegel + Prüfsummen).

```bash
aria2c -M download.metalink
```

`aria2c --checksum=sha-256=<hash> <url>` — Prüft die Integrität des Downloads mit einer Prüfsumme.

```bash
aria2c --checksum=sha-256=abc123... https://example.com/file.iso
```

## BitTorrent

`aria2c <torrent-file>` — Lädt über eine Torrent-Datei herunter.

```bash
aria2c ubuntu-24.04-desktop-amd64.iso.torrent
```

`aria2c '<magnet-link>'` — Lädt über einen Magnet-Link herunter.

```bash
aria2c 'magnet:?xt=urn:btih:abc123...'
```

`aria2c --seed-time=0 <torrent>` — Lädt herunter und beendet sich sofort ohne zu seeden.

```bash
aria2c --seed-time=0 file.torrent
```

`aria2c --select-file=<indices> <torrent>` — Lädt nur bestimmte Dateien eines Torrents herunter.

```bash
aria2c --select-file=1,3,5 file.torrent
```

`aria2c -S <torrent>` — Zeigt die Dateien eines Torrents an, ohne zu laden.

```bash
aria2c -S file.torrent
```

## Authentifizierung & Header

`aria2c --http-user=<user> --http-passwd=<pass> <url>` — Lädt mit HTTP-Basic-Authentifizierung herunter.

```bash
aria2c --http-user=admin --http-passwd=secret https://private.example.com/file.zip
```

`aria2c --header='<header>' <url>` — Fügt einen eigenen HTTP-Header hinzu.

```bash
aria2c --header='Authorization: Bearer token123' https://api.example.com/export
```

`aria2c --ftp-user=<user> --ftp-passwd=<pass> <url>` — Lädt per FTP mit Zugangsdaten herunter.

```bash
aria2c --ftp-user=admin --ftp-passwd=secret ftp://ftp.example.com/backup.tar.gz
```

`aria2c --all-proxy=<proxy> <url>` — Nutzt einen Proxy für Downloads.

```bash
aria2c --all-proxy=http://proxy:8080 https://example.com/file.zip
```

## RPC & Daemon-Modus

`aria2c --enable-rpc` — Startet aria2 als Daemon mit JSON-RPC-Schnittstelle.

```bash
aria2c --enable-rpc --rpc-listen-all=true --daemon
```

`aria2c --enable-rpc --rpc-secret=<token>` — Startet den RPC-Daemon mit Authentifizierungs-Token.

```bash
aria2c --enable-rpc --rpc-secret=mysecret --daemon
```

`aria2c --conf-path=<file>` — Nutzt eine eigene Konfigurationsdatei.

```bash
aria2c --conf-path=~/.config/aria2/aria2.conf
```

`aria2c --save-session=<file> --save-session-interval=60` — Speichert die Download-Sitzung für spätere Fortsetzung.

```bash
aria2c --save-session=session.txt --save-session-interval=60 -i urls.txt
```

`aria2c --input-file=<session-file>` — Stellt Downloads aus einer gespeicherten Sitzung wieder her.

```bash
aria2c --input-file=session.txt
```

<!-- PROSE:outro -->
## Fazit

aria2 entfaltet seinen vollen Nutzen bei großen Dateien und schlechten Verbindungen: Mehrfachverbindungen und Spiegel-Unterstützung holen aus der verfügbaren Bandbreite das Maximum heraus. Für wiederkehrende Download-Aufgaben lohnt sich eine `aria2.conf` mit dem RPC-Daemon – so steuerst du Downloads bequem über Frontends wie Aria2 Web UI oder Browser-Erweiterungen, ohne jedes Mal eine neue Shell zu öffnen.

## Weiterführende Links

- [aria2 – offizielle Dokumentation](https://aria2.github.io/) – Handbuch und RPC-Referenz (englisch)
- [aria2c(1) – Manpage](https://aria2.github.io/manual/en/html/aria2c.1.html) – alle Optionen im Überblick (englisch)
- [aria2 – Wikipedia](https://en.wikipedia.org/wiki/Aria2) – Hintergrund und Geschichte (englisch)
<!-- PROSE:outro:end -->

## Verwandte Kommandos

- [wget](https://www.jpkc.com/db/cheatsheets/networking/wget/) – Dateien und ganze Verzeichnisbäume von Servern herunterladen
- [curl](https://www.jpkc.com/db/cheatsheets/networking/curl/) – HTTP-Requests, APIs und Downloads auf der Kommandozeile
- [scp](https://www.jpkc.com/db/cheatsheets/networking/scp/) – Dateien sicher über SSH übertragen

