Is Shoko Server Mandatory?
The short answer, Yes.
Shoko Server is where all the magic happens. It acts as a central database for every program and plugin under the Shoko suite allowing you to access, maintain and watch your anime collection. This also means that Shoko Server must be running to use any other program or plugin that connect to it. Outside of file importing, Shoko Server is no more resource intensive than other programs you probably have running in the background, so you don’t need to worry about Shoko Server eating up resources.
Navigate to the Shoko Downloads page and download Shoko Server, unless told otherwise we always recommend downloading the Stable version. The installer will guide you through the installation process and should only take a couple of minutes.
Make sure you have docker installed before you continue. For most users are installing docker from their package manager is advised, this way you will keep up with the latest updates and security updates. On the homepage of Docker you can find the installation procedure for your distribution of the Docker Community Edition.
First things first, download the image, and unless otherwise told, install the version tagged as
$ docker pull shokoanime/server:latest
Now, you can run the command below, after substituting the paths below (the second and third volume mount point) with path(s) leading to your library and/or import folders.
$ docker run -d --name shokoserver --restart always -p 8111:8111 -v "$HOME/.shoko:/home/shoko/.shoko" -v "/path/to/anime:/mnt/anime" -v "/path/to/import:/mnt/import" -e PUID=$UID -e PGID=$GID --shm-size 256m shokoanime/server:latest
If you want a more detailed explanation, then refer to the below table for a break-down of the above command:
|Create a docker container from an image.|
Offloads the process to the background. If you want to control the container, you can either omit this flag or run docker attach followed by the container name to reattach to the container.
If you do not assign a container name with the
|Automatically restart the server on failure.|
Make the container automatically restart if it fails. Shoko is bound to fail a few times, so setting this flag ensures that it will automatically restart and resume where it left of.
|Publish the container's ports.|
Binds the container's port to the same port on the host system, because otherwise a random port will be chosen on the host system - which we don't want to happen.
To preserve settings between updates, the settings folder must be remapped to a location outside the container. By default we map it to a folder in the user's home directory
-v "/path/to/anime:/mnt/anime" -v "/path/to/import:/mnt/import"
In order for Shoko Server to manage your collection, you must map at least one volume to the container.
Note #1: The first path in the mapping (
Note #2: You can mount multiple library folders, and/or import folders, and they can be named any way you like (e.g. /anime, /import, /export, /tv_shows, etc.).
Note #3: When importing hard-linked files, be sure to mount the common root between your import folder and library folder. Otherwise you will get duplicate files, because the containers sees the mount-points as separate disks, and will copy-and-delete the file from the import folder to the drop-destination.
-e PUID=$UID -e PGID=$GID
|Set Environment Variables.|
You can instruct the server to run as a certain set of user/group ids. This makes working with permissions a lot easier since you can match your server with a local account without effort. The example argument will make the server run with the uid and gid of the current user, to find the value to use for
You can set the timezone with the
|Specifies the Image to derive the container from.|
|Set Larger Shared Memory for AVDump3.|
AVDump3 requires access to a larger portion of shared IPC memory than the 64MB available by default in docker containers, otherwise it might core dump when starting the dump process. Increasing it to 256MB is enough to avoid this.
Note: AVDump3 is currently only available on the daily version of the server. If you're on stable then you can ignore this argument.
|Set Environment Variable for AVDump2.|
AVDump2 currently requires large dependencies, so by specifying this environment variable, it tells the container to pull the dependencies for AVDump2 to work.
Note: AVDump2 is currently only available on the stable version of the server. If you're on daily then you can ignore this argument.
Docker Compose (Linux)
To make management easier, we can combine all the previous items in a docker compose file.
In order to make this work, install docker-compose, a guide how to can be found here on the Docker website. Once docker-compose is installed, create a docker-compose.yml file anywhere on your system. Open the file and put the following inside, but remember to substitute the paths below with path(s) leading to your library and/or import folders.
version: "3" services: shoko_server: shm_size: 256m container_name: shokoserver image: shokoanime/server:latest restart: always environment: - "PUID=$UID" - "PGID=$GID" - "TZ=Etc/UTC" ports: - "8111:8111" volumes: - "$HOME/.shoko:/home/shoko/.shoko" - "/path/to/anime:/mnt/anime" - "/path/to/import:/mnt/import"
This combines all of our previous configuration in an easy to read and edit format, and will allow you to create a powerful startup script that could (for example) include a MySQL server, a download client, and anything else you can think of that’s available in a docker format.
Make sure you have Docker installed on your Synology NAS before you continue. This package can be found in the Package Center, under Third-party.
You will need to find your User ID (UID) before continuing. Log in to your Synology NAS using SSH and type
You’ll see the UID: note down the number for later. To avoid getting your database cleared on updates, you can also
create a folder in the
docker shared folder named
shokoserver on the host and map it to
in the container with R/W access.
Open Docker from the Application Menu, then go to the Containers tab. You’ll need to download the
Synology Container File and fill out the anime folder path and replace the
PUID your User’s ID you previously acquired.
Once that’s done, go to Settings, Import and select the file you’ve just modified. Name the container
shokoserver, then apply!
Note #1: If you want to edit volumes or environment variables, you’ll need to stop the container first.
Note #2: If you intend to use the daily version of the server then AVDump3 might crash since we are unable to modify the shared IPC memory size through the proprietary container format Synology uses, so if you do use this method to install the server then you have been warned.
Once the server is installed, follow the instructions on the First Run Setup page to configure your fresh install of Shoko Server.