Eases the setup of a media server that requires as little manual input as possible.
For displaying and streaming your media
For sorting your anime after downloading them
For downloading media
For securing your connection over HTTPS/TLS and handling incoming requests
Cloudflare Tunnel (Cloudflared)
For securing your local router, preventing your IP from being exposed and eliminating the need for opening up a port in your router
./caddy- lets you quickly reload your Caddy config if you made changes to the Caddyfile by running
./qBittorrent/scripts/hardlink-torrent.sh- used with qBittorrent to create hardlinks to your torrents on successfully completed download. This allows you to keep seeding after Shoko moves the files elsewhere. Files can be deleted from the downloads folder if you no longer wish to seed. All hardlinks to a file has to be deleted for the file to be deleted.
./update.shwill force rebuild (and update) all containers.
Install Docker on your system. Easiest way is to just download Docker Desktop and let it handle it.
Make sure you setup Cloudflare with your domain. Log into cloudflare and follow the setup in the domains tab.
You need to setup
cloudflared once and copy over some files to get the tunnel working. You can follow this guide to set it up locally. I'll summarise it here quickly but will skip how to install the
cloudflared package as that varies by distro.
Run this command to generate required files
cloudflared tunnel login
Then this one to create a tunnel. The name can be anything you want that helps you recognise the server.
cloudflared tunnel create <NAME>
Run this for each of the subdomains,
files.domain.tld and if you want a way to quickly test if Caddy is working, you can also add
domain.tld with your domain. You can use different subdomains by changing them in the
cloudflared tunnel route dns <UUID or NAME> <hostname>
An example of the command above could be
cloudflared tunnel route dns example-pc ping.example.com
Copy the credentials file to
./Cloudflared/config/ (it should be stored in
sudo cp ~/.cloudflared/<UUID>.json ~/Documents/media-server/Cloudflared/config/
The name of the credentials file above is the UUID of the tunnel, put that in the
.env file as instructed in the next step.
.env file based on the content in
.env.example. The example will include comments that will help with what value is needed there.
The CF_API_TOKEN requires you to follow this guide. You can either follow the second step or the third step. If you follow the second step, you can skip the part about downloading some Caddy packages as the Dockerfile handles that already. Just skip to the part about generating an API token
Use strong passwords for all services!! A strong password is one that is long, not one that uses lots of weird symbols.
qBittorrent defaults to username 'admin' and password 'adminadmin'. Make sure you go into the settings under WebUI and change that immediately!
After going through the setup (or potentially during setup) set the import folders like this
Anime Source -> /mnt/import using drop type "source" and enabling "watch for new files"
Anime Destination -> /mnt/anime using drop type "Destination"
Go to settings and adjust these settings
Rename on Import = true
Move on Import = true
Move after rename = true
Auto Group Series = true
You'll have to add the Shokofin plugin to Jellyfin. Do that by going to
Settings -> Dashboard -> Plugins. In there go to the
Repositories tab at the top. Add new
Now you have to go to the
Catalog tab and install Shokofin (might be named Shoko). Restart Jellyfin after this.
Go back to the Plugins list and click Shoko/Shokofin to configure.
This lets Jellyfin talk to Shoko directly rather than going through Cloudflare for each request.
For Library settings I recommend using these settings
Series/Season Grouping: Group series into Seasons based on Shoko's Groups
Box-Sets/Movie Grouping: Create Box-sets based upon Shoko's Groups and Series entries
Finally the advanced settings
Public Shoko host URL:
Add AniDB ID to items: enabled
You should enable transcoding to offload work from the CPU to the GPU. This process varies from GPU to GPU and detailed setup can be found here. The current config is based on using an Nvidia GPU, in which case you only have to select the Nvidia NVENC option under Hardware Accelleration.
For this, you need to set the hardlinker script to run after download.
Set the default downloads folder to /base/downloads. At the top of the downloads settings, set the
Torrent content layout setting to
Run external program on torrent completion and put this in the input field
/scripts/hardlink-torrent.sh "%R" "/base/import/%N"
Also set download category as Anime for anime, Music for music, and Movies for movies. You can add more categories in the
Shoko server has a local interface for use with Shoko Desktop in case you need that. The URL for that is