This project is intended to quickly set up the AniHub server-side environment, and assumes you have public network access, a domain, and Cloudflare integrated. If your situation does not match, you will need a different setup approach.
If you do not have a public IP, use the independent Cloudflare Tunnel setup.
Single docker-compose.yml repository that runs:
- Caddy (HTTPS + WebDAV + Aria2 RPC reverse proxy)
- Aria2
+-----------+ +-----------+ +-----------+
|Device A💻 | |Device B📱 | |Device C🖥️|
+-----------+ +-----------+ +-----------+
\ | /
\ v /
+--------------------+
| Caddy 🔐 HTTPS |
+---------+----------+
/ \
v v
+-----------------------------+
| docker compose stack |
| +--------+ +----------+ |
| |aria2⬇️ | |WebDAV📁 | |
| +--------+ +----------+ |
+-----------------------------+
-
Get project files (HTTPS clone or download ZIP):
git clone https://github.com/ihciah/AniHubDocker.git cd AniHubDockerOr open the repository page in browser and click
Code->Download ZIP. -
Copy env template:
cp .env.example .env
-
Create a Cloudflare API Token:
- Open: https://dash.cloudflare.com/profile/api-tokens
- Click
Create Token, and chooseCreate Custom Token. - Make sure to use a scoped API token, NOT a global API key.
- It will need two permissions:
Zone - Zone - ReadZone - DNS - Edit- Save the generated token for
.env.
-
Edit
.env:- set domains
- set
HTTPS_PORTif you do not want to use443 - set
DATA_DIRto a large external disk path - replace
CLOUDFLARE_API_TOKEN - replace
ARIA2_RPC_SECRET(must be non-empty) - set
WEBDAV_AUTH_PAIRS(for example:admin:pass1;guest:pass2)
-
Start:
docker compose up -d
-
Check status:
docker compose ps docker compose logs -f caddy docker compose logs -f aria2
- This setup uses
network_mode: host, which is typically for Linux hosts. - Caddy HTTPS listen port can be changed by
HTTPS_PORTin.env(default443). - Download/WebDAV data is mapped from external
DATA_DIR(not in repo). aria2RPC secret is not stored inaria2.conf; it is injected from.env.- WebDAV users are configured by
WEBDAV_AUTH_PAIRS; password hashes are generated at container startup. - All previously hardcoded secrets are removed and replaced by environment values.
WEBDAV_AUTH_PAIRSformat isuser:password;user2:password2.- Do not use
;in usernames/passwords, and do not use:in passwords. - Aria2 state data is stored in
./aria2/databy default.