Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save YamashitaRen/743a423fcbdf661d0e43b4d0fe91baf9 to your computer and use it in GitHub Desktop.
Save YamashitaRen/743a423fcbdf661d0e43b4d0fe91baf9 to your computer and use it in GitHub Desktop.
This is installation documentation for installing Koel on Debian 8.

Installation on Debian 8

This is installation documentation for installing Koel on Debian 8.

Install Dependancies

Most packages can be installed via apt-get.

user@debian:~/$ sudo apt-get install -y apache2 mysql-server php5 php5-mysql g++ git curl

Composer

More information about installing Composer can be found on its website here.

user@debian:~/$ sudo su
root@debian:/home/user# curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer
root@debian:/home/user# exit

Node

The node package in the default Debian repo is too old. There is more information about installing newer versions for Ubuntu and Debain here, but the following will be enough.

user@debian:~/$ sudo su
root@debian:/home/user# curl -sL https://deb.nodesource.com/setup_4.x | bash -
root@debian:/home/user# exit
user@debian:~/$ sudo apt-get install -y nodejs

Prepare the database

Create the database, a user for the service, and then grant permissions for that user.

user@debian:~/$ mysql -u root -p
Enter password:
mysql> CREATE DATABASE koel DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
mysql> CREATE USER 'koel-db-user'@'localhost' IDENTIFIED BY 'koel-pass';
mysql> GRANT ALL PRIVILEGES ON koel.* TO 'koel-db-user'@'localhost' WITH GRANT OPTION;
mysql> exit;

Prepare the project

user@debian:~/$ git clone https://github.com/phanan/koel.git
user@debian:~/$ cd koel
user@debian:~/koel$ npm install
user@debian:~/koel$ composer install

Edit the .env file with the necessary configuration changes. Below are example configuration changes made via sed.

user@debian:~/koel$ sed -i 's/ADMIN_EMAIL=/[email protected]/g' .env
user@debian:~/koel$ sed -i 's/ADMIN_NAME=/ADMIN_NAME=admin/g' .env
user@debian:~/koel$ sed -i 's/ADMIN_PASSWORD=/ADMIN_PASSWORD=admin-pass/g' .env
user@debian:~/koel$ sed -i 's/DB_CONNECTION=/DB_CONNECTION=mysql/g' .env
user@debian:~/koel$ sed -i 's/DB_HOST=/DB_HOST=127.0.0.1/g' .env
user@debian:~/koel$ sed -i 's/DB_DATABASE=homestead/DB_DATABASE=koel/g' .env
user@debian:~/koel$ sed -i 's/DB_USERNAME=homestead/DB_USERNAME=koel-db-user/g' .env
user@debian:~/koel$ sed -i 's/DB_PASSWORD=secret/DB_PASSWORD=koel-pass/g' .env

Now initialize the database and then start serving the site.

user@debian:~/koel$ php artisan koel:init
user@debian:~/koel$ php artisan serve

This will only allow connections from the localhost. If you would like to accept connections from other hosts, start the server by providing the 'host' option.

user@debian:~/koel$ php artisan serve --host 0.0.0.0

The site should be up now. Browes to it and sign in with the admin credentials we set in the .env file.
Username: [email protected]
Password: admin-pass

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment