Simplify installation steps to match v3 install

This commit is contained in:
Roger Gonzalez 2024-12-26 09:55:44 -03:00
parent 0e7ba98890
commit 7ac08e29b4
Signed by: rogs
GPG Key ID: C7ECE9C6C36EC2E6

View File

@ -7,14 +7,14 @@ summary: First steps to install YAMS on your server
## Dependencies
This script only depends on:
This script depends on:
- Debian 12 (recommended) or Ubuntu 22.04. If your OS is not ready, you need to figure that out first. Here are some guides:
+ https://www.digitalocean.com/community/tutorials/initial-server-setup-with-debian-11
+ https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu
- Your OS must be fully configured. That means:
+ You have a user that is not `root`.
+ You can run `sudo apt update` and `sudo apt upgrade` without errors.
+ You have a user that is not `root`
+ You can run `sudo apt update` and `sudo apt upgrade` without errors
+ If you are using Ubuntu **make sure you are NOT installing the snap version of docker.** The snap version runs in a sandbox and doesn't have access to the OS.
If you run `which docker` and get this output:
```
@ -22,224 +22,120 @@ This script only depends on:
/snap/bin/docker
```
You **won't** be able to install YAMS. ⚠️
- [docker](https://www.docker.com/). If you don't have it installed, YAMS is going to install it for you.
- [docker-compose](https://docs.docker.com/compose/). If you don't have it installed, YAMS is going to install it for you.
If you havent installed `docker` and `docker-compose`, dont worry! The script will attempt to run both installations (it only works in Debian and Ubuntu!)
- Required commands: `curl`, `docker`, `sed`, and `awk`
- Docker and Docker Compose (the script can install these for you on Debian/Ubuntu systems)
## Before running
Before installing, make sure you have:
- **An installation location:** The script is going to ask you for an install location, but it will default to `/opt/yams`. Just make sure your current user has permissions to write on the selected directory.
- **A media folder:** This is the folder where all your files are going to be downloaded and categorized. For example, if you choose `/srv/media`, the script is going to create the following folders:
+ `/srv/media/tv`: For your TV shows.
+ `/srv/media/movies`: For your movies.
+ `/srv/media/downloads`: For your torrent downloads.
+ `/srv/media/blackhole`: For your torrents blackhole.
- **A regular user to run and own the media files:** You shouldnt use `root` for this user, but Im not your father, nothing is going to stop you lol.
- **A VPN service (optional but STRONGLY recommended):** If you can, choose one from [this list](/advanced/vpn#official-supported-vpns). The VPN I always recommend is [ProtonVPN](https://protonvpn.com/).
- **An installation location:** The script defaults to `/opt/yams` but you can choose any location where your user has write permissions
- **A media folder:** This is where your files will be downloaded and organized. For example, if you choose `/srv/media`, the script will create:
+ `/srv/media/tv`: For TV shows
+ `/srv/media/movies`: For movies
+ `/srv/media/music`: For music
+ `/srv/media/books`: For books
+ `/srv/media/downloads`: For downloads
+ `/srv/media/blackhole`: For torrent blackhole
- **A regular user to run and own the media files:** Avoid using `root`
- **A VPN service (optional but STRONGLY recommended):** Choose from [this list](/advanced/vpn#official-supported-vpns). [ProtonVPN](https://protonvpn.com/) is recommended.
## To install
## Installation Steps
### Setup your install location (location is optional, you can choose any other location)
### 1. Setup Installation Location
The location `/opt/yams` is **recommended**, but you can use whatever you like if your current user has permissions on the directory.
The location `/opt/yams` is **recommended**, but you can use any location where your user has permissions:
```bash
sudo mkdir -p /opt/yams
sudo chown -R $USER:$USER /opt/yams
```
### If you already have docker and docker-compose installed...
### 2. Check Docker Installation
Make sure you can run `docker` **without** `sudo`!
If you already have Docker installed, ensure you can run it without sudo:
If you run `docker` with `sudo` and another user other than `root` you'll encounter multiple permission errors. You can find instructions on how to run `docker` without `sudo` here: https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user.
```bash
docker run hello-world
```
If you can run `docker run hello-world` without `sudo`, you can continue. If you encounter any other `docker` issue, go here: [Common docker permission errors](/faqs/common-errors/#common-docker-permission-errors).
If this fails, follow the [Docker post-installation steps](https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user) or check the [Common docker permission errors](/faqs/common-errors/#common-docker-permission-errors).
### Inspecting the `install` script by yourself (optional).
### 3. Clone YAMS
Its always a good practice to verify and study the scripts you run on your machine. You can always inspect [`install.sh`](https://gitlab.com/rogs/yams/-/blob/master/install.sh?ref_type=heads) script in the Gitlab repo here: https://gitlab.com/rogs/yams/-/blob/master/docs.org. You don't have to be a complete expert in `bash` (I'm definitely not lol), but if you have any experience with the Linux terminal you should be able to at least understand what's happening.
### Cloning from Gitlab
To install YAMS, please clone the installer to a location outside your chosen installation directory. I recommend using `/tmp/yams`.
Clone the installer to a temporary location:
```bash
git clone --depth=1 https://gitlab.com/rogs/yams.git /tmp/yams
cd /tmp/yams
```
### Installing YAMS
### 4. Run the Installer
```bash
bash install.sh
```
You'll see the following prompt:
```bash
====================================================
___ ___ ___
___ / /\ /__/\ / /\
/__/| / /::\ | |::\ / /:/_
| |:| / /:/\:\ | |:|:\ / /:/ /\
| |:| / /:/~/::\ __|__|:|\:\ / /:/ /::\
__|__|:| /__/:/ /:/\:\ /__/::::| \:\ /__/:/ /:/\:\
/__/::::\ \ \:\/:/__\/ \ \:\~~\__\/ \ \:\/:/~/:/
~\~~\:\ \ \::/ \ \:\ \ \::/ /:/
\ \:\ \ \:\ \ \:\ \__\/ /:/
\__\/ \ \:\ \ \:\ /__/:/
\__\/ \__\/ \__\/
====================================================
Welcome to YAMS (Yet Another Media Server)
Instalation process should be really quick
We just need you to answer some questions
====================================================
The installer will guide you through several configuration steps:
#### Docker Installation (if needed)
If Docker isn't installed, the script will offer to install it:
```
Checking prerequisites...
⚠️ docker not found! ⚠️
Do you want YAMS to install docker and docker-compose? IT ONLY WORKS ON DEBIAN AND UBUNTU! [y/N]: y
⚠️ Docker/Docker Compose not found! ⚠️
Install Docker and Docker Compose? Only works on Debian/Ubuntu (y/N) [Default = n]:
```
You can choose `y` to install `docker` and `docker-compose` with YAMS or `n` to exit the script.
When docker finishes the installation OR if you already had `docker` and `docker-compose` installed, you should see the following message at the bottom:
#### User Configuration
```bash
Checking prerequisites...
docker exists ✅
docker-compose exists ✅
Where do you want to install the docker-compose file? [/opt/yams]:
User to own the media server files? [current-user]:
```
Enter the username that will own the media files. The default is your current user.
You should choose the path where you want YAMS to be installed. Like I said before, the `/opt/yams` directory **is recommended**, but you can use whatever you like if your current user has permissions on the directory. Type the path you'll like to use and press `[ENTER]` to continue.
#### Directory Configuration
```bash
What's the user that is going to own the media server files? [your_current_user]:
Installation directory? [/opt/yams]:
Media directory? [/srv/media]:
Are you sure your media directory is "/srv/media"? (y/N) [Default = n]:
```
Confirm your installation and media directories. The script will create them if they don't exist.
Now, you have to choose the user that is going to own your media files. **I strongly suggest you don't use `root` for this user**, but you can do whatever you want. The script is going to default to the current `$USER` running the script. Type the user you want to own the files and press `[ENTER]` to continue.
```bash
Please, input your media directory [/srv/media]:
```
My suggestion is to use something like `/srv/media`, but you _might_ want to use an external hard drive or a different partition on your machine. Just type the full path of the directory you want to use and press `[ENTER]` to continue. If it doesn't exist, the script is going to try to create it.
```bash
Are you sure your media directory is "/srv/media"? [y/N]:
```
Select `y` or `n` if you are happy with the folder you selected. Press `[ENTER]` to continue.
#### Media service
#### Media Service Selection
```bash
Time to choose your media service.
Your media service is responsible for serving your files to your network.
By default, YAMS supports 3 media services:
Supported media services:
- jellyfin (recommended, easier)
- emby
- plex (advanced, always online)
Choose your media service [jellyfin]:
```
It's time to configure the media service!
Select your preferred media service. Jellyfin is recommended for beginners.
By default, YAMS supports 3 big media services:
- [Jellyfin](https://jellyfin.org) (recommended): In my opinion, Jellyfin is the best one. It's fast, easy to configure and Open Source.
- [Emby](https://emby.media): Emby its the one I use on my local config. It's very similar to Jellyfin (Jellyfin is a fork of Emby), and it has almost the same functionalities. The reason I'm not recommending it is because it has a paid plan and it's closed source.
- [Plex](https://plex.tv): I only recommend Plex to advanced users or people who need all the extra stuff it provides, because the interface and all the services might be a little overwhelming if this is your first time with a home server. I dont like it that much because its always online, and it has more functionalities than I need. Also, at least in YAMS, its the hardest to configure. But if you want to share your media server with other people easily, Plex is the way to go! Jellyfin and Emby can share media outside your network, but they are a little more complicated to configure.
Type one from the list and press [ENTER]. If you don't choose anything, the installer is going to default to Jellyfin.
#### VPN
#### VPN Configuration
```bash
Time to set up the VPN.
You can check the supported VPN list here: https://yams.media/advanced/vpn.
Do you want to configure a VPN? [Y/n]:
Supported VPN providers: https://yams.media/advanced/vpn
Configure VPN? (Y/n) [Default = y]:
VPN service? (with spaces) [protonvpn]:
VPN username (without spaces):
VPN password:
```
Configure your VPN settings if desired. The script supports all VPNs listed at `/advanced/vpn#official-supported-vpns`.
Now it's time to configure the VPN. The automatic installer supports all the VPNs on [this list](/advanced/vpn#official-supported-vpns), but **I strongly recommend using ProtonVPN** because it's easy to setup port forwarding later on.
### 5. Final Installation
If want to configure a VPN, select `Y` and continue with these instructions. If you don't have a VPN or don't want to use a VPN, choose `N` and move to [finishing the installation](#finishing-the-installation). You can set your VPN later in the [qBittorrent configuration](/config/qbittorrent). **You should always use a VPN when downloading torrents!**
The script will:
1. Copy and configure all necessary files
2. Start the YAMS services
3. Install the YAMS CLI tool
4. Set appropriate permissions
When complete, you'll see a success message and URLs for all services:
```bash
What's your VPN service? (with spaces) [protonvpn]:
```
First, select your VPN provider. You can go to [this list](/advanced/vpn#official-supported-vpns) and verify the name of your VPN.
```bash
You should read protonvpn's documentation in case it has different configurations for username and password.
The documentation for protonvpn is here: https://github.com/qdm12/gluetun-wiki/blob/main/setup/providers/protonvpn.md
What's your VPN username? (without spaces):
```
Now, just enter your VPN username. If it has spaces, delete them.
```bash
What's your VPN password? (if you are using mullvad, just enter your username again):
```
Then, enter your VPN password. The script is going to output `*` characters to hide your password, so don't worry about leaking your password on the screen.
### Finishing the installation
```bash
Copying docker-compose.example.yaml to /opt/yams/docker-compose.yaml...
docker-compose.example.yaml was copied successfuly! ✅
Copying .env.example to /opt/yams/.env...
.env.example was copied successfuly! ✅
Copying docker-compose.custom.yaml to /opt/yams/docker-compose.custom.yaml...
docker-compose.custom.yaml was copied successfuly! ✅
Everything installed correctly! 🎉
Running the server...
This is going to take a while...
...
...
...
```
If you get a `docker` permission error, go [here](/faqs/) to fix it.
After a lot of docker installing, you'll get a message like this at the end:
```bash
We need your sudo password to install the YAMS CLI and configure permissions...
```
In this step, YAMS needs your `sudo` password to configure the `yams` helper.
```bash
YAMS CLI installed successfully ✅
Media directory ownership and permissions set successfully ✅
Install directory ownership and permissions set successfully ✅
Configuration folder "/opt/yams/config" exists ✅
Configuration folder ownership and permissions set successfully ✅
```
And the installer ends like this:
```bash
========================================================
_____ ___ ___ ___
/ /::\ / /\ /__/\ / /\
/ /:/\:\ / /::\ \ \:\ / /:/_
/ /:/ \:\ / /:/\:\ \ \:\ / /:/ /\
/__/:/ \__\:| / /:/ \:\ _____\__\:\ / /:/ /:/_
\ \:\ / /:/ /__/:/ \__\:\ /__/::::::::\ /__/:/ /:/ /\
\ \:\ /:/ \ \:\ / /:/ \ \:\~~\~~\/ \ \:\/:/ /:/
\ \:\/:/ \ \:\ /:/ \ \:\ ~~~ \ \::/ /:/
\ \::/ \ \:\/:/ \ \:\ \ \:\/:/
\__\/ \ \::/ \ \:\ \ \::/
\__\/ \__\/ \__\/
========================================================
All done!✅ Enjoy YAMS!
You can check the installation on /opt/yams
========================================================
Everything should be running now! To check everything running, go to:
Service URLs:
qBittorrent: http://your.ip.address:8081/
SABnzbd: http://your.ip.address:8080/
@ -249,21 +145,17 @@ Lidarr: http://your.ip.address:8686/
Readarr: http://your.ip.address:8787/
Prowlarr: http://your.ip.address:9696/
Bazarr: http://your.ip.address:6767/
jellyfin: http://your.ip.address:8096/
Media Service: http://your.ip.address:8096/
Portainer: http://your.ip.address:9000/
You might need to wait for a couple of minutes while everything gets up and running
All the services location are also saved in ~/yams_services.txt
========================================================
To configure YAMS, check the documentation at
https://yams.media/config
========================================================
```
And that's it!
These URLs are also saved to `~/yams_services.txt` for future reference.
In your browser, you can visit each of the sites to check that they are running correctly. If one of them doesn't show up, you might need to wait a couple of minutes for docker to finish the full installation.
## Next Steps
After installation completes, proceed to the [configuration documentation](https://yams.media/config) to set up your media server.
If you encounter any issues:
- Check the [Common Issues](/faqs/common-errors/) page
- Visit the [YAMS Forum](https://forum.yams.media)
- Join our [Discord](https://discord.gg/Gwae3tNMST) or [Matrix](https://matrix.to/#/#yams-space:rogs.me) chat