Skip to content

Instantly share code, notes, and snippets.

@brahmlower
Last active June 8, 2021 09:03
Show Gist options
  • Save brahmlower/613a99156d603abac083 to your computer and use it in GitHub Desktop.
Save brahmlower/613a99156d603abac083 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

@brahmlower
Copy link
Author

I've removed two unnecessarily negative comments from this thread. As such, I'd like to make a couple points:

  1. Github doesn't show notification when a Gist receives a comment, even if you tag me in the message. Because of this, I haven't seen many of your comments and questions in a timely manner.
  2. Please recognize the passage of time in relation to this guide. The last revision of this was written back in early 2016. That was about 2.5 years ago, and one major Debian release ago. In that timespan, the installation requirements for Koel have very likely changed. If you plan to use the guide for installation, expect to encounter problems.

I understand that unclear/incomplete/aged documentation can be frustrating to work with. Believe me when I say I've been there- that's in part why I wrote this guide in the first place. But that's what you sign up for when working with software. Though it looks like activity on this Gist is dying down, I'd like to request future commenters follow the Rust code of conduct and understand that this is a place for constructive communication only.

@lilp69
Copy link

lilp69 commented Apr 4, 2019

Hello, when I try to run : php artisan koel:init
I've this issue : PHP Warning: require(/usr/local/koel/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /usr/local/koel/bootstrap/autoload.php on line 17
PHP Fatal error: require(): Failed opening required '/usr/local/koel/bootstrap/../vendor/autoload.php' (include_path='.:/usr/share/php') in /usr/local/koel/bootstrap/autoload.php on line 17

I try : composer update -no--scripts, but still have issue.

Thanks

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