Skip to content
This repository was archived by the owner on Feb 11, 2019. It is now read-only.

Install from Source (Ubuntu)

chimerasoup edited this page Jan 20, 2019 · 18 revisions

Ubuntu (18.04)

  1. Open your favorite terminal app
  2. Run the cd command to where you want to install stash.
  3. Update your system by running sudo apt-get update && apt-get dist-upgrade
  4. Install an LTS release of Nodejs using the install instructions at https://nodejs.org/en/
  5. Install yarn (a node package manager) by using Yarn's install instructions at https://yarnpkg.com/lang/en/docs/install/#debian-stable
  6. Install stash's required dependencies by running sudo apt-get install -y ffmpeg imagemagick libmagic-dev aria2 ruby ruby-dev ruby-bundler sqlite3 libsqlite3-dev nginx git dialog zlib1g-dev patch liblzma-dev
  7. Install optional dependencies if you want to enable the metadata scraper: sudo apt-get install -y chromium-chromedriver aria2 curl
  8. Make a folder for the stash app and change to that folder by running mkdir -p /home/app/stash && cd /home/app/stash (or whatever you want to call it).
  9. Run the following command to download the server git clone https://github.com/stashapp/stashserver.git
  10. Run the following command to download the frontend git clone https://github.com/stashapp/stashfrontend.git
  11. Stop nginx by running systemctl stop nginx
  12. Remove the default nginx site by running sudo rm /etc/nginx/sites-enabled/default
  13. Copy the server nginx config by running sudo cp stashserver/docker/nginx_proxy.conf /etc/nginx/sites-available/stash.conf
  14. Enable the stashserver site in nginx sudo ln -s /etc/nginx/sites-available/stash.conf /etc/nginx/sites-enabled/stash.conf
  15. Modify the server nginx config by running sudo sed -i 's#/home/app/stash/public#'pwd'/stashserver/public#' /etc/nginx/sites-enabled/stash.conf
  16. Copy the frontend nginx config by running sudo cp stashserver/docker/nginx_frontend.conf /etc/nginx/sites-enabled/stash_frontend.conf
  17. Enable the frontend site in nginx sudo ln -s /etc/nginx/sites-available/stash_frontend.conf /etc/nginx/sites-enabled/stash_frontend.conf
  18. Modify the frontend nginx config by running:sudo sed -i 's#/home/app/frontend#'pwd'/stashfrontend/dist#' /etc/nginx/sites-enabled/stash_frontend.conf
  19. Change to the server directory: cd stashserver
  20. Make sure your gem installer works ok gem install bundler
  21. Install the gems with: bundle install
  22. Make a file called application.yml located in the stashserver/config folder and edit the paths as necessary. Here is an example (change the paths where it makes sense for you)
# The location of your videos and zipped pics (galleries).
stash_directory: '/path/to/your/videos/and/pics'

# The location metadata should be exported to, previews, etc.
stash_metadata_directory: '/home/app/stash/metadata'

# The location to store cache files
stash_cache_directory: '/home/app/stash/cache'

# The location to store scraped downloads
stash_downloads_directory: '/home/app/stash/downloads'
  1. Set up the database with rails db:migrate. Test that the server runs correctly by typing rails s. If there are no errors then you have set it up correctly. Push Ctrl+C to quit the server.
  2. Run this command to change over to the frontend folder: cd ../stashfrontend
  3. Install Gulp CLI globally: sudo yarn global add gulp
  4. Install Angular CLI globally: sudo yarn global add @angular/cli
  5. Build the frontend with ng build --prod
  6. Start nginx again with: systemctl restart nginx
  7. Change back to the stashserver directory: cd ../stashserver
  8. Run the back end stashserver with rails s
  9. Open a new terminal, Change back to the stashfront end directory: cd /home/app/stash/stashfrontend and run the update_schema.sh in the stashfrontend directory. You might have to run this periodically after updating your git repos.

You should now be able to access the app from http://your_ip_here:8008 as long as the server is running in the terminal.

Clone this wiki locally