Installing on Synology NAS
Table of Contents
Synology devices comes in two categories : those who support containerization through Docker, and those who don’t. To see in which category you stand, refer to the “Applied Models” section of the Docker Package page.
Now, follow the installation instructions based on whether you can use Docker or you cannot use Docker.
To install Stash with Docker
- Make sure the Docker app is installed and running correctly.
- Search the registry for stash and install.
- Create a stash image with the following set up in ‘advanced options’
|docker/Stash/generated||/generated||Thumbnails, clips, etc|
|(where your porn lives)||/data||Location of your porn|
(These will need to be the same as the Volumes you created in the “Volume” tab.
|PATH||(keep as is)|
You will need to set a default port in the “Port” tab, otherwise Docker will assign a different port every time Stash is launched. Leave the container port as-is.
Make sure that “Use The Same Network As Docker Host” is checked.
(thanks to backer Herelam80 for these instructions)
To install Stash without Docker
Warning : this method uses SSH to run command lines on the NAS. If you are unfamiliar with SSH or linux command lines, I suggest you not to go further, as making a mistake in the SSH session can really screw your NAS.
This is intended to work on DSM 7.0 and later. It will not work on any version prior to 7.0.
In DSM, navigate to
Control Panel > Terminal & SNMP and check the
enable SSH service box.
Note : only members of the adminstrator group are able to use SSH, you’ll need one of them to complete the installation.
Create a user that will run stash
- In DSM, navigate to
Control Panel > User & Group
- Click on the
- Give it a name (eg stash) and Generate a Random Password (you won’t need it later)
Nextuntil you are on the “Assign shared folders permissions” screen
- Assign the read write permission to your porn folder (the write permission is needed to allow the deletion of clips from the stash app)
Nextuntil you are on the “Assign application permissions” screen
Denyfor all applications
Nextuntil you can click on
Connect to your NAS
With your terminal, connect to your NAS using an account that is part of the administrator group.
- SSH to your NAS
- navigate to the stash user home directory
- Download the lastest ARM64 version of stash and its checksum from github
wget https://github.com/stashapp/stash/releases/download/[version]/stash-linux-arm64v8 wget https://github.com/stashapp/stash/releases/download/[version]/CHECKSUMS_SHA1
- Perform the checksum validation
sha1sum -c --ignore-missing CHECKSUMS_SHA1 # you should see a line that says `stash-linux-arm64v8: OK`
- Clean up unnecessary file
Note : DO NOT run stash yet or it will generated a bunch of files/folders where we don’t want them
- Donwload the ARM64 static build of ffmpeg and its checksum
wget https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-arm64-static.tar.xz wget https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-arm64-static.tar.xz.md5
- Perform the checksum validation
md5sum -c ffmpeg-release-arm64-static.tar.xz.md5 # you should see a line that says `ffmpeg-release-arm64-static.tar.xz: OK`
- Unpack & move ffmpeg to the .stash/ folder
tar xvf ffmpeg-release-arm64-static.tar.xz mv ffmpeg-4.4-arm64-static/ffmpeg ffmpeg-4.4-arm64-static/ffprobe .stash/
- Clean up unnecessary files
rm ffmpeg-release-arm64-static.tar.xz rm ffmpeg-release-arm64-static.tar.xz.md5 rm -rd ffmpeg-4.4-arm64-static/
- Prepare a python environment (for scrapers)
sudo -H python -m ensurepip --upgrade python3 -m venv stash-env source stash-env/bin/activate pip3 install pipreqs
Whenever you install a new scraper, do the following from the stash user home directory
source stash-env/bin/activate cd your_scraper_directory pipreqs . sudo pip3 install -r requirements.txt
Configure your NAS to run Stash upon startup
- Create the service file by running
cat > /etc/systemd/system/stash.service, copy/pasting the following, and hitting CTRL+D when it’s done to save the file (hit again if you are not back to the prompt) :
[Unit] Description=Run Stash at startup After=network.target [Service] Type=simple User=stash ExecStart=/bin/bash -c '\ source /var/services/homes/stash/stash-env/bin/activate stash-env; \ exec /var/services/homes/stash/stash-linux-arm64v8' Restart=on-failure [Install] WantedBy=multi-user.target # end
- Start and activate the service
sudo systemctl start stash.service sudo systemctl enable stash.service
Verify that it is working
You can now access to stash by navigating to your NAS url on port 9999 :