Deployment guide

Shoko Server

Overview

Shoko Server is an open-source (MIT licensed), self-hosted server for organising an anime media collection. It hashes every file in your library, matches it against AniDB using your own AniDB account, and builds a browsable catalogue of series, episodes and metadata. You manage the catalogue from a Web UI and a full REST API.

This SecureAnyCloud image runs the official Shoko Server container (shokoanime/server, pinned to a stable release), bound to loopback behind an nginx reverse proxy on port 80. All Shoko state lives on a dedicated Azure data disk. On the first boot of every VM, the image creates a unique administrator password before the web front door opens.

What you get:

  • Shoko Server (stable v5.3.x) from the official shokoanime/server Docker image, running as shoko-server.service
  • nginx on :80 as a reverse proxy to the loopback Shoko backend (127.0.0.1:8111), with WebSocket upgrade headers for Shoko's realtime events
  • A per-VM administrator account (Default) created on first boot and recorded in a root-only file. The Family Friendly admin, which always had a blank password, is removed, and blank and default logins are rejected.
  • A dedicated 40 GiB Azure data disk at /var/lib/shoko holding the SQLite database, settings and downloaded metadata
  • SQLite as the datastore: a single node with no separate database service to run
  • shoko-server.service + nginx.service as systemd units, enabled and active
  • 24/7 SecureAnyCloud support

Prerequisites

You need an active Azure subscription, an SSH key pair, and a VNet with a subnet in the target region.

Standard_B2s (2 vCPU / 4 GiB RAM) is a good starting size. In the network security group, allow inbound 22/tcp from your management network and 80/tcp. Shoko serves plain HTTP on port 80, so for production, terminate TLS in front of it with your own domain.

To match files against AniDB, you need your own free AniDB account. The image never includes one.

Step 1 - Deploy from the Azure Marketplace

Sign in to the Azure Portal, choose Create a resource, search the Marketplace for Shoko Server by SecureAnyCloud, and select Create.

On the Basics tab, pick your subscription, resource group, region and size. Under Administrator account, choose SSH public key and paste your key. Under Inbound port rules, allow SSH (22) and HTTP (80).

Review the dedicated data disk on the Disks tab, then select Review + create and Create.

Step 2 - Deploy from the Azure CLI

Accept the Marketplace terms once per subscription, create the VM, and open port 80:

# Accept the Marketplace terms once per subscription (required before the first CLI deploy)
az vm image terms accept --urn sac1647283583153:shoko:default:latest
az vm create \
  --resource-group <your-rg> \
  --name shoko \
  --image sac1647283583153:shoko:default:latest \
  --size Standard_B2s \
  --admin-username azureuser \
  --ssh-key-values ~/.ssh/id_ed25519.pub \
  --vnet-name <your-vnet> --subnet <your-subnet> \
  --public-ip-sku Standard
az vm open-port --resource-group <your-rg> --name shoko --port 80 --priority 1010

Step 3 - Connect to your VM

Connect to the VM over SSH:

ssh azureuser@<vm-public-ip>

Step 4 - Confirm the services are running

Check that both services are active:

systemctl is-active shoko-server.service nginx.service

Both report active. On first boot, the Shoko container starts and its first-boot service drives the Shoko setup API to create a per-VM administrator. nginx opens only once that password is in place.

Step 5 - Retrieve your admin password

The first boot of your VM generates a unique password for the Default administrator and writes it to a root-only file. Read the file:

sudo cat /root/shoko-credentials.txt

The file contains SHOKO_URL, SHOKO_ADMIN_USER (Default) and SHOKO_ADMIN_PASSWORD. Store the password somewhere safe.

Step 6 - Confirm the health endpoint

nginx serves an unauthenticated health endpoint on :80 for load balancers and probes. Call it:

curl -s http://localhost/healthz; echo

It returns ok. Shoko's own unauthenticated startup-status endpoint reports the server state and, once the server is ready, Started:

curl -s http://localhost/api/v3/Init/Status

Step 7 - Sign in to the Web UI

Browse to http://<vm-public-ip>/ and sign in as user Default with the password from Step 5.

After you sign in, you land on the dashboard. The image ships without any media, so the collection is empty. This is the correct starting state, exactly like a fresh Shoko install. The dashboard shows the queue processor, the unrecognised-files panel and your collection statistics.

Step 8 - Connect your AniDB account

Shoko identifies your files by matching them against AniDB. Open Settings -> AniDB, enter your own AniDB username and password under Login Options, and click Test. Your AniDB credentials are never stored in the image. You enter them only here, on your own VM.

Step 9 - Point Shoko at your media

Open Settings -> Import to review how files are imported (renaming, moving and the recognised video extensions). Then add an Import Folder that points at where your anime files live on the VM, for example a folder under /var/lib/shoko or an attached share. Shoko hashes each file, matches it against AniDB and builds your collection automatically.

Step 10 - Verify authentication from the command line (optional)

Shoko's authentication endpoint rejects a blank or wrong password and accepts the per-VM Default password, returning an apikey. Use the SHOKO_ADMIN_PASSWORD from Step 5 to run the round trip below, and substitute your own password for <SHOKO_ADMIN_PASSWORD>:

# authenticate as the per-VM Default admin and read the current user
TOKEN=$(curl -s -X POST -H 'Content-Type: application/json' \
  -d '{"user":"Default","pass":"<SHOKO_ADMIN_PASSWORD>","device":"cli"}' \
  http://localhost/api/auth | jq -r '.apikey')
curl -s -H "apikey: $TOKEN" http://localhost/api/v3/User/Current | jq '{Username, IsAdmin}'

A correct password returns an apikey, and the current-user object shows "Username": "Default" and "IsAdmin": true. A blank password, a wrong password and the removed Family Friendly account are all rejected. An anonymous request to the API returns HTTP 401.

Step 11 - Confirm data lives on the dedicated disk

All Shoko state (the SQLite database, settings and downloaded metadata) is stored on the dedicated Azure data disk, so it survives OS changes and can be resized independently. Confirm the mount:

findmnt /var/lib/shoko

A separate Azure data disk backs the mount. The disk is captured into the image and re-provisioned on every VM.

Maintenance

  • Admin users: manage users from Settings -> User Management in the Web UI.
  • AniDB: your AniDB login lives under Settings -> AniDB. You supply it, and the image never includes it.
  • Data: the SQLite database, settings and metadata all live under /var/lib/shoko on the dedicated data disk. Snapshot the disk to back Shoko up.
  • TLS: Shoko serves plain HTTP on port 80. Before you run it in production, front it with TLS (for example, certbot) and your own domain.
  • Upgrades: pull a newer Shoko image and restart the service. For example, run sudo docker pull shokoanime/server:<new-tag>, edit the tag in /etc/systemd/system/shoko-server.service, then run sudo systemctl daemon-reload && sudo systemctl restart shoko-server.service.
  • Security patches: unattended-upgrades stays enabled, so the OS keeps receiving security updates automatically.

Support

SecureAnyCloud provides 24/7 expert support for this image. Contact sales@secureanycloud.com.

Deploy on Azure

Launch Shoko Server on Ubuntu 24.04 LTS on Azure with 24/7 support from SecureAnyCloud.

View this image

Need Help?

Our support team is available 24/7.

sales@secureanycloud.com

Deploy on Azure