How to setup Koel personal music streaming server in 10 simple steps


  • administrators
    | 52456 points

    Koel is a simple web-based personal audio streaming service written in Vue at the client side and Laravel on server side. Targetting web developers, Koel embraces some of the more modern web technologies – flexbox, audio and drag-and-drop API to name a few – to do its job.


    I make this tutorial to demonstrate how easy it is (and how to overcome troubleshoots) when using Laragon with a project from github.
    You can use the same process for other github projects as well.

    1. Make sure Laragon is running, press Ctrl + Alt + T to open Terminal
    Ctrl + Alt + T 
    
    1. In Terminal, first jump your Document Root
    cd C:\laragon\www
    
    1. Clone koel project, and jump to the project
    git clone https://github.com/phanan/koel.git && cd koel
    
    1. Install npm-install-missing (this module will attempt to reinstall any missing dependencies).
    npm install -g npm-install-missing
    
    1. Install nodejs dependencies. (You can press Ctrl + T to open a new tab and run Step 6 simultaneously. If you find any errors, run the command again)
    npm install 
    
    1. Install php dependencies
    composer install
    
    1. Modify .env file
    # After that, it can (and should) be removed from this .env file
    ADMIN_EMAIL=login@email.com
    ADMIN_NAME=leokhoa
    ADMIN_PASSWORD=secret
    ....
    DB_HOST=localhost
    DB_DATABASE=koel
    DB_USERNAME=root
    DB_PASSWORD=
    
    1. Click Start All button to start Apache & MySQL servers. Laragon will detect and make beautiful url: http://koel.dev
      If not, right click to open menu, click Apache/Reload

    2. Create MySQL database for koel

     mysqladmin -u root  create koel
    
    1. Init database & done!
    php artisan init
    

    Now, navigate to http://koel.dev, you should have your personal music streaming server up & running


  • | 227 points

    Thank you so much for writing this tutorial. Laragon has definitely made it really simple to spin up a server and test out new projects. I am really happy that you chose Koel as an example project, I think its a really cool music streaming server that will get more popular with time. Thanks again!


  • | 722 points

    Hi all,
    unfortunately after step 5 I receive many similar errors telling me that "Path and/or specified filename is too long. The completed filename must contains less than 260 characters, the folder name must contains ess than 248 characters." (This is not the exact message, I try to translate manually in english because I received it in italian).

    How can I solve this problem?

    Thank you very much for your help.

    Lapo


  • | 227 points

    This post is deleted!

  • | 227 points

    @lapoguidi I think maybe you have installed Laragon in a folder that is within many different folders and that is why when NPM dependencies are being installed you are getting the "path name is too long" error. Try installing Laragon as close to the C: drive you can, without putting it in many different folders.


  • | 722 points

    Hello mm1143,
    I have laragon as a subfolder of the root.

    This is the first error:

    C:\laragon\www\koel\node_modules\laravel-elixir\node_modules\browser-sync\node_modules\socket.io\node_modules\socket.io-client\node_modules\engine.io-client\node_modules\ws\node_modules\utf-8-validate {git} 02/01/2016 16.49.23,17
    (node "C:\laragon\bin\nodejs\node_modules\npm\bin\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node rebuild )
    Compilazione dei progetti nella soluzione uno alla volta. Per abilitare la compilazione parallela, aggiungere l'opzione "/m".

    **C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets(312,5
    ): error MSB3491: impossibile scrivere righe nel file "Release\obj\validation\validatio
    n.tlog\validation.lastbuildstate". Percorso e/o nome di file specificato troppo lungo.
    Il nome di file completo deve contenere meno di 260 caratteri, mentre il nome di directory deve contenere meno di 248 caratteri. **

    [C:\laragon\www\koel\node_modules\laravel-elixir\node_modules\browser-sync\node_modules\socket.io\node_modules\socket.io-client\node_modules\engine.io-client\node_modules\ws\node_modules\utf-8-validate\build\validation.vcxproj]

    gyp ERR! build error
    gyp ERR! stack Error: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe failed with exit code: 1
    gyp ERR! stack at ChildProcess.onExit (C:\laragon\bin\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:270:23)
    ERR! stack at emitTwo (events.js:87:13)
    gyp ERR! stack at ChildProcess.emit (events.js:172:7)
    gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
    gyp ERR! System Windows_NT 10.0.10586
    "C:\laragon\bin\nodejs\node.exe" "C:\laragon\bin\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
    gyp ERR! cwd C:\laragon\www\koel\node_modules\laravel-elixir\node_modules\browser-sync\node_modules\socket.io\node_modules\socket.io-client\node_modules\engine.io-client\node_modules\ws\node_modules\utf-8-validate
    gyp ERR! node -v v4.2.3
    gyp ERR! node-gyp -v v3.0.3
    gyp ERR! not ok

    Unfortunately I'm not so expert, I'm just a programmer that would like to learn something new, so any help is really appreciated.

    Thank you.

    Lapo


  • administrators
    | 52456 points

    @lapoguidi : node-gyp is unstable on Windows, so you may try running 'npm install' again some times. If you are lucky, errors will disappear...

    If you find any errors, run the command again

    npm install 
    

  • | 722 points

    Thanks leokhoa,
    trying and retrying, at the end koel starts.
    Unfortunately 2 errors still there, so audio files are imprted but not played.
    Now I'll try to figure the errors out.
    Thank you for you help.

    Lapo


  • | 125 points

    @lapoguidi I had a similar issue with another npm project I was working on.
    Turns out dependency path names can be insanely long.
    And in Windows, we have a 260 character limit.

    The solution I found was to use the --no-bin-links argument with npm things:

    npm install --no-bin-links

    Give that a try. =)


Log in to reply
 

Looks like your connection to Laragon was lost, please wait while we try to reconnect.