{"id":18386,"date":"2016-01-11T10:18:49","date_gmt":"2016-01-11T16:18:49","guid":{"rendered":"https:\/\/www.rosehosting.com\/blog\/?p=18386"},"modified":"2022-12-12T04:33:34","modified_gmt":"2022-12-12T10:33:34","slug":"install-koel-on-an-ubuntu-14-04-vps","status":"publish","type":"post","link":"https:\/\/www.rosehosting.com\/blog\/install-koel-on-an-ubuntu-14-04-vps\/","title":{"rendered":"How to install Koel on Ubuntu 14.04"},"content":{"rendered":"
In this article, we will explain how to install Koel on an Ubuntu 14.04 VPS<\/strong> with MariaDB, PHP-FPM and Nginx. Koel is an audio streaming service written in Vue at the client side and Laravel on server side. This guide should work on other Linux VPS<\/a> systems as well but was tested and written for an Ubuntu 14.04 VPS<\/a>. To add the MariaDB repository to your sources list and install the latest MariaDB server, run the following commands:<\/p>\n When the installation is complete, run the following command to secure your installation:<\/p>\n Next, we need to create a database for the Koel installation.<\/p>\n To install the latest stable version of PHP version 7 and all necessary modules, run:<\/p>\n Composer is a dependency manager for PHP with which you can install packages. Composer will pull in all the required libraries and dependencies you need for your project.<\/p>\n We will install the latest nodejs package from the nodesource repository.<\/p>\n Create a root directory for your Koel using the following command:<\/p>\n Clone the project repository from GitHub:<\/p>\n Change to public_html the directory:<\/p>\n Run npm to install all npm packages including bower and gulp:<\/p>\n and install all PHP dependencies using composer<\/p>\n Edit the Finally initialize the database with:<\/p>\n Create a new PHP-FPM pool for your user:<\/p>\n Do not forget to change your_user with your username.<\/p>\n Restart PHP-FPM:<\/p>\n Ubuntu 14.04 comes with Nginx version 1.4, to install the latest stable version of Nginx version 1.8, run:<\/p>\n Generate a self signed ssl certificate:<\/p>\n If you don’t want to get warnings associated with self-signed SSL Certificates, you can purchase a trusted SSL certificate<\/a>.<\/p>\n Next, create a new Nginx server block:<\/p>\n Do not forget to change your_user with your username.<\/p>\n Activate the server block by creating a symbolic link :<\/p>\n Test the Nginx configuration and restart nginx:<\/p>\n Open Of course you don\u2019t have to do any of this if you use one of our Linux VPS Hosting<\/a> services, in which case you can simply ask our expert Linux admins to setup this for you. They are available 24×7 and will take care of your request immediately.<\/p>\n PS<\/strong><\/span>. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.<\/p>\n","protected":false},"excerpt":{"rendered":" In this article, we will explain how to install Koel on an Ubuntu 14.04 VPS with MariaDB, PHP-FPM and Nginx. … <\/p>\n
\n<\/p>\nLogin to your VPS via SSH<\/h4>\n
ssh user@vps_IP<\/pre>\n
Update the system and install necessary packages<\/h4>\n
[user]$ sudo apt-get update && sudo apt-get -y upgrade\r\n[user]$ sudo apt-get install software-properties-common git nano<\/pre>\n
Install MariaDB 10.0<\/h4>\n
[user]$ sudo apt-key adv --recv-keys --keyserver hkp:\/\/keyserver.ubuntu.com:80 0xcbcb082a1bb943db\r\n[user]$ sudo add-apt-repository 'deb http:\/\/ftp.osuosl.org\/pub\/mariadb\/repo\/10.0\/ubuntu trusty main'\r\n[user]$ sudo apt-get update\r\n[user]$ sudo apt-get install -y mariadb-server<\/pre>\n
[user]$ mysql_secure_installation<\/pre>\n
[user]$ mysql -uroot -p<\/pre>\n
MariaDB [(none)]> CREATE DATABASE koeldb;\r\nMariaDB [(none)]> GRANT ALL PRIVILEGES ON koeluser.* TO 'koeldb'@'localhost' IDENTIFIED BY 'koeluserpasswd';\r\nMariaDB [(none)]> FLUSH PRIVILEGES;\r\nMariaDB [(none)]> \\q<\/pre>\n
Install PHP, composer and required PHP modules<\/h4>\n
[user]$ LC_ALL=en_US.UTF-8 sudo add-apt-repository -y ppa:ondrej\/php\r\n[user]$ sudo apt-get update\r\n[user]$ sudo apt-get -y install php7.0-fpm php7.0-cli php7.0-gd php7.0-mysql php7.0-mcrypt php-pear php7.0-curl<\/pre>\n
[user]$ curl -sS https:\/\/getcomposer.org\/installer | php\r\n[user]$ sudo mv composer.phar \/usr\/local\/bin\/composer<\/pre>\n
Install Node.Js<\/h4>\n
[user]$ curl -sL https:\/\/deb.nodesource.com\/setup_5.x | sudo -E bash -\r\n[user]$ sudo apt-get install -y nodejs<\/pre>\n
Install Koel<\/h4>\n
[user]$ mkdir -p ~\/myKoel.com\/{public_html,logs}<\/pre>\n
[user]$ git clone https:\/\/github.com\/phanan\/koel.git ~\/myKoel.com\/public_html<\/pre>\n
[user]$ cd ~\/myKoel.com\/public_html<\/pre>\n
[user]$ npm install<\/pre>\n
[user]$ composer install<\/pre>\n
.env<\/code> file with the database and admin details.<\/p>\n
[user]$ nano ~\/myKoel.com\/public_html\/.env<\/pre>\n
ADMIN_EMAIL=admin@myKoel.com\r\nADMIN_NAME=admin\r\nADMIN_PASSWORD=adminpasswd\r\n\r\nDB_DATABASE=koeldb\r\nDB_USERNAME=koeluser\r\nDB_PASSWORD=koeluserpasswd<\/pre>\n
[user]$ php artisan init<\/pre>\n
PHP-FPM configuration<\/h4>\n
[user]$ sudo nano \/etc\/php\/7.0\/fpm\/pool.d\/your_user.conf\r\n[your_user]\r\nuser = your_user\r\ngroup = your_user\r\nlisten = \/var\/run\/php-fpm-your_user.sock\r\nlisten.owner = your_user\r\nlisten.group = your_user\r\nlisten.mode = 0666\r\npm = ondemand\r\npm.max_children = 5\r\npm.process_idle_timeout = 10s\r\npm.max_requests = 200\r\nchdir = \/\r\n<\/pre>\n
[user]$ sudo service php7.0-fpm restart<\/pre>\n
Install and configure Nginx<\/h4>\n
[user]$ sudo add-apt-repository -y ppa:nginx\/stable\r\n[user]$ sudo apt-get update\r\n[user]$ sudo apt-get -y install nginx<\/pre>\n
[user]$ sudo mkdir -p \/etc\/nginx\/ssl\r\n[user]$ cd \/etc\/nginx\/ssl\r\n[user]$ sudo openssl genrsa -des3 -passout pass:x -out koel.pass.key 2048\r\n[user]$ sudo openssl rsa -passin pass:x -in koel.pass.key -out koel.key\r\n[user]$ sudo rm koel.pass.key\r\n[user]$ sudo openssl req -new -key koel.key -out koel.csr\r\n[user]$ sudo openssl x509 -req -days 365 -in koel.csr -signkey koel.key -out koel.crt<\/pre>\n
[user]$ sudo nano \/etc\/nginx\/sites-available\/myKoel.com<\/pre>\n
server {\r\n listen 443 default;\r\n server_name myKoel.com;\r\n root \/home\/your_user\/myKoel.com\/public_html\/public;\r\n\r\n location \/ {\r\n try_files $uri $uri\/ \/index.php?$query_string;\r\n }\r\n\r\n ssl on;\r\n ssl_certificate \/etc\/nginx\/ssl\/koel.crt;\r\n ssl_certificate_key \/etc\/nginx\/ssl\/koel.key;\r\n ssl_session_timeout 5m;\r\n ssl_ciphers 'AES128+EECDH:AES128+EDH:!aNULL';\r\n ssl_protocols TLSv1 TLSv1.1 TLSv1.2;\r\n ssl_prefer_server_ciphers on;\r\n\r\n access_log \/var\/log\/nginx\/koel.access.log;\r\n error_log \/var\/log\/nginx\/koel.error.log;\r\n\r\n location ~ \\.php$ {\r\n fastcgi_split_path_info ^(.+\\.php)(\/.+)$;\r\n fastcgi_pass unix:\/var\/run\/php-fpm-your_user.sock;\r\n fastcgi_index index.php;\r\n include fastcgi_params;\r\n fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\r\n fastcgi_intercept_errors off;\r\n fastcgi_buffer_size 16k;\r\n fastcgi_buffers 4 16k;\r\n }\r\n\r\n location ~ \/\\.ht {\r\n deny all;\r\n }\r\n}\r\n\r\nserver {\r\n listen 80;\r\n server_name myKoel.com;\r\n\r\n add_header Strict-Transport-Security max-age=2592000;\r\n rewrite ^ https:\/\/$server_name$request_uri? permanent;\r\n}\r\n<\/pre>\n
[user]$ sudo ln -s \/etc\/nginx\/sites-available\/myKoel.com \/etc\/nginx\/sites-enabled\/myKoel.com<\/pre>\n
[user]$ sudo nginx -t\r\n[user]$ sudo service nginx restart<\/pre>\n
https:\/\/myKoel.com\/login<\/code> in your favorite web browser and you should see the Koel login screen. That\u2019s it. You have successfully installed Koel on your Ubuntu 14.04 VPS. For more information about how to manage your Koel installation, please refer to the official Koel <\/a> documentation.<\/p>\n
\n