# Install Polaris Music Streaming Server on Debian

## Installing Polaris

1. Log into the Linux device
2. Run the following commands in a terminal window
   # update software repositories
   sudo apt update
   # install software updates
   sudo apt upgrade -y
   # install prerequisite software
   sudo apt install binutils pkg-config libssl-dev -y
   # install the rust compiler, press 1 when prompted
   sudo curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
   # add rust/cargo to current terminal
   source $HOME/.cargo/env
   # download the latest build of polaris
   wget -Opolaris-latest.tar.gz https://github.com/agersant/polaris/releases/download/0.13.4/Polaris_0.13.4.tar.gz
   # extract the downloaded .tar.gz
   sudo tar xzvf polaris-latest.tar.gz
   # install polaris
   cd polaris
   make install-xdg
   # once the buld and installation complete, start the polaris server
   ~/.local/bin/polaris
3. Open a web browser and navigate to http://DNSorIP:5050
4. At the Welcome to Polaris screen click the Sounds Good button
5. Enter a path for Polaris to look for media in and give it a name, ie ~/Music/ > Click Next
6. Enter a username and password to create a Polaris login > Click Next
7. Welcome to Polaris

## Starting Polaris On System Boot

1. Back in the terminal run the following command
   sudo nano /etc/systemd/system/polaris.service
2. Paste the following configuration into the polaris.service file, replacing i12bretro from the user, working directory and exec start values with the correct username

   [Unit]
   Description=Polaris Service
   After=network.target

   [Service]
   Type=simple
   RemainAfterExit=yes
   User=i12bretro
   WorkingDirectory=/home/i12bretro/.local/bin
   ExecStart=/home/i12bretro/.local/bin/polaris
   Restart=on-failure
   [Install]
   WantedBy=default.target

3. Press CTRL+O, Enter, CTRL+X to write the changes to polaris.service
4. Enter the following command to start the new service on system boot
   sudo systemctl enable polaris
5. Reboot the system
6. Test that Polaris is running by opening a web browser and navigating to http://DNSorIP:5050
7. Log back into Polaris with the username and password created earlier